How can a SQL query have two from clauses?

前端 未结 3 1075
刺人心
刺人心 2021-01-17 16:24

This just looks so odd to me:

delete from GearsDev.dbo.Products 
from GearsDev.dbo.Products as C
inner join #Common as M
    on M.item = C.ItemNumber
         


        
3条回答
  •  天涯浪人
    2021-01-17 17:00

    From MSDN The second from allows you create a filter that corresponding rows in the first from are deleted where they match.

    In this case Delete all [GearsDev].[dbo].[Products] where ItemNumber has a corresponding row in #Common with the item of the same value

提交回复
热议问题