Click here to Skip to main content
15,887,304 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am trying to delete contents from table named "tasks" by joining it with another table "tasktype". But am getting an error when trying to delete.
It says incorrect syntax near INNER.
Here is what i have tried.

SQL
DELETE FROM tasks t
INNER JOIN tasktype tt
ON t.tasktypeID = tt.tasktypeID
WHERE tt.tasktypename = 'Ad-hoc'


Thank you.
Posted

1 solution

Try this:

SQL
DELETE 
FROM t
FROM tasks t
INNER JOIN tasktype tt
ON t.tasktypeID = tt.tasktypeID
WHERE tt.tasktypename = 'Ad-hoc'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900