Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

I want to delete using INNER JOIN in SQL Server 2008.

But I get this error:

Msg 156, Level 15, State 1, Line 15

Incorrect syntax near the keyword 'INNER'.

My code:

DELETE FROM WorkRecord2 

INNER JOIN Employee ON EmployeeRun=EmployeeNo

WHERE Company = '1' AND Date = '2013-05-06'

1 Answer

0 votes
by (40.7k points)

Use this query along with the alias name:

DELETE w

FROM WorkRecord2 w

INNER JOIN Employee emp

ON EmployeeRun=EmployeeNo

WHERE Company = '1' AND Date = '2013-05-06'

 Note: You must specify what table are you deleting from. 

Related questions

0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...