Re: delete based on multipart key
Posted in 1997
Douglas Wilson — — source: Informix-list mailing list archive (1991-1998)
David Williams wrote:
(snip)
> delete from first_table
> where 1 in
> (select 1 from first_table,second_table
> where first_table.a = second_table.a and
> first_table.b = second_table.b)>
(snip)
> Somehow though I still don't feel I totally understand WHY it works...
I thought that you couldn't reference the same table in a
subquery of a delete or update. Also it seems like the 'first_table'
in the subquery has no join to the 'first_table' in the main
'delete from' clause. Is this a bug, a feature, or both (or are
David and I just ignorant? :) ) I'll have to try it though.
Douglas Wilson