Friday, February 17, 2012

delete query with inner join

Hallo,
Can anybody let me know what I need to change to make this query work:
delete
from a
inner b
on a.item = b.item
I get the error message "Incorrect syntax near the keyword 'inner'."
Thanks,
Stephen.Hallo,

Can anybody let me know what I need to change to make this query work:

delete
from a
inner b
on a.item = b.item

I get the error message "Incorrect syntax near the keyword 'inner'."

Thanks,
Stephen.

Have you tried?

INNER JOIN b on...|||Hi Steve o

Key word is join rather than inner. Also, you'll need to use an EXISTS or IN statement rather than a join if you are deleting

HTH|||Check BOL for delete statment,
Here is the corect syntax,

delete a
from a
inner join b
on a.item = b.item

No comments:

Post a Comment