Showing posts with label inner. Show all posts
Showing posts with label inner. Show all posts

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

Delete query that doesn't work ?

Hi!

Do you know why this query is ok on SQL 2005 and not on SQL ce ?

Code Snippet

DELETE ProfilesGroups

FROM ProfilesGroups pg

INNER JOIN Groups g

ON tpGroupID = g.gId

WHERE pg.tpProfileID = '7df60fae-a026-4a0b-878a-0dd7e5308b09'

AND g.gProfileID = '8a6859ce-9f99-4aaf-9ed6-1af66cd15894'

Thx for help ;-).

PlaTyPuS

You can only reference a single table in a delete statement on SQL CE - a SQL CE limitation :-)