sql-server - sql server 2008 full - ¿Cómo puedo eliminar usando INNER JOIN con SQL Server?

sql server 2008 r2 management studio / sql / sql-server-2008 / inner-join / sql-delete

Quiero eliminar usando INNER JOIN en SQL Server 2008 .

Mi código:

DELETE FROM WorkRecord2 
INNER JOIN Employee ON EmployeeRun=EmployeeNo
WHERE Company = '1' AND Date = '2013-05-06'

Peter Mortensen



Answer #1

Esto es lo que uso actualmente para borrar o incluso,actualizar:

DELETE           w
FROM             WorkRecord2   w,
                 Employee      e
WHERE            w.EmployeeRun = e.EmployeeNo
             AND w.Company = '1' 
             AND w.Date = '2013-05-06'