请问这两条更新语句哪一个效率更高?为什么?
第一条:
UPDATE @BD_MTLCategoryTable SET [IsHaveChild] = 1
FROM @BD_MTLCategoryTable A
INNER JOIN [BD_MTLCategory] B ON A.[MTLCategoryId] = B.[ParentId]
第二条:
UPDATE @BD_MTLCategoryTable SET [IsHaveChild] = 1
FROM @BD_MTLCategoryTable A
WHERE EXISTS (SELECT B.[MTLCategoryId] FROM [BD_MTLCategory] B WHERE B.[ParentId] = A.[MTLCategoryId])
------解决方案--------------------习惯用第一条
------解决方案--------------------大记录,第一条更快