Re: SQL question ...
Posted in 1996
David Williams <djw@smooth1.demon.co.uk> wrote: : Here is a way which will work under all versions but I'm not sure : why it works....(I got this from an Ingres expert and used to today). : This was joining on 4 columns deleting 26 rows out of ~1300. It does : work but why?? Just when I though I knew SQL.... : delete from A where 1 in : (select 1 from A,B where A.C1 = B.C1 and A.C2 = B.C2) This is exactly the same as exists David. If the where clause of the select results in at least one row beeing returned the 1 is in the set (or rather bag in this case) returned. It has exactly the same problems with speed as if you simply used exists instead of "1 in". Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org