Re: delete based on multipart key
Posted in 1997
Rudy Fernandes — — source: Informix-list mailing list archive (1991-1998)
In article <pz67yez52w.fsf@eeyore.ibcinc.com>,
Roderick Schertler <roderick@argon.org> wrote:
>What's the right way to delete rows from a table which match a
>multi-part key? I've got a table with a two part key and a unique
>composite index on the key columns. I can't figure out an efficient way
>to delete all the rows whose keys appear in a second table.
<Snip>
>I want to be left with
>
> 1 b
> 2 a
>
Try the following in isql
delete from first_table
where a || b in ( select a || b from second_table);
Under 4GL, this statement has to be PREPAREd.
This works with OL 7.20UC4 and 4GL 6.04. Hope it can work for you, too.
Cheers,
----------------------
Rudy Fernandes
GIC, Kuwait
----------------------