Oliver Peters <oliver....@web.de> wrote:
> sqlite> DELETE FROM a w
>   ...> WHERE EXISTS(
>   ...> SELECT 1 FROM b WHERE id = w.id)
>   ...> ;
> Error: near "w": syntax error

SQL syntax doesn't allow for an alias in DELETE statement (nor in INSERT or 
UPDATE).

See if this helps:

delete from a where id in (select id from b);

> I assume that this is wanted behaviour and will happen too when I try this 
> using
> UPDATE. Could somebody explain why this has to happen?

SQL-92 standard says so.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to