RE: SQL advice please
Posted in 2000
Don't know if this is any faster
DELETE FROM table_a WHERE EXISTS
(SELECT 'x' FROM table_b
WHERE table_a.col_a = col_a
AND table_a.col_b = col_b)
but the other way is fraught with peril:
table_a.col_a = "xx"
table_a.col_b = "yy"
table_b.col_a = "x"
table_b.col_b = "xyy"
> -----Original Message-----
> From: Steve Barnes [SMTP:sgbarnes99@hotmail.com]
> Sent: Tuesday, February 29, 2000 7:25 AM
> To: informix-list@iiug.org
> Subject: SQL advice please
>
> Morning all and Obnoxio,
>
> I am trying to delete some rows from a table where the same columns exist
> in
> another table, but there are two columns to check. I want to delete all
> rows
> in table_a where col_a and col_b are in table_b.
>
> The only way I have so far is as follows
>
> DELETE FROM table_a WHERE trim(col_a)||trim(col_b) IN
> (SELECT trim(col_a)||trim(col_b) from table_b)>
> Does anyone know of a better way?
>
> Thanks
>
> Steve
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com