Re: delete based on multipart key
Posted in 1997
Rudy Fernandes wrote:
>
> In article <pz67yez52w.fsf@eeyore.ibcinc.com>,
I can't figure out an efficient way
> >to delete all the rows whose keys appear in a second table.
> delete from first_table
> where a || b in ( select a || b from second_table);
This works, but it is not exactly efficient since it will
not take advantage of the index on first_table columns (a,b).
Using a cursor in a procedural language will do the trick.
Which reminds me, I've mentioned this before and I'll mention it
again, there ought to be syntax for this multi-part sort of thing like
so:
delete from first_table
where a,b in (select a,b from second_table)
Seems simple and reasonable enough to me. How does one get this
into the next set of ANSI standards?
Of course, they also ought to have case-insensitive searching.
Even mSQL provides a 'CLIKE' operator for such a purpose.
Enough griping, back to work,
Douglas Wilson