Re: SQL question ...
Posted in 1996
>>> How do I delete from A where C1,C2 in(select C1,C2 from B where XXX) ; Here's a quick-and-dirty method. Run this query: select "delete from table_A where column_1 = ", column_1, " and column_2 = ", column_2, " ; " from table_B where XXXX which gives you an output something like this: (constant) delete from table_A where column_1 = column_1 0 (constant) and column_2 = column_2 1 (constant) ; (constant) delete from table_A where column_1 = column_1 2 (constant) and column_2 = column_2 0 (constant) ; (constant) delete from table_A where column_1 = column_1 2 (constant) and column_2 = column_2 1 (constant) ; [...] Pipe that output through "cut -c15-80", then you have a SQL script that does what you want. If column_1 and/or column_2 *are* chars then you need to do a bit of additional fooling about to get quotes around their values. - Paul ************************************************************************* Disclaimer: All opinions expressed in this message are well-reasoned and insightful; needless to say, they are not those of Informix Software, its partners or lackeys. Anyone who says otherwise is itching for a fight.