How can a SQL query have two from clauses?

前端 未结 3 1072
刺人心
刺人心 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 16:57

    You can constrain the set of records you want to delete by more than one table. The second from just generates the alias C for the table you delete from, joins it with the table #common and deletes only records which have a record in talbe #common.

提交回复
热议问题