Re: SQL Anomaly?
Posted in 1996
Jonathan Leffler (johnl@informix.com) wrote: : What you had was actually a horrible correlated sub-query... : DELETE FROM tmp_kontakt : WHERE s_doknr IN (SELECT UNIQUE(tmp_kontakt.s_doknr) FROM kontakt) : Note the extra table specifier. : [...] : It was a correctly formatted subquery, but not the one you thought it was. Thanks for the info! It sure was an eye-opener for me! : Hands up if you haven't been bitten by something similar at some time... : My hand is firmly on the keyboard! What would have happened if "s_doknr" (and not "ko_s_doknr") had indeed been the column name in table "kontakt"? Would it have returned the correct result, or would the same correlated subquery have resulted? Regards, Richard -- +----------------------------+-------------------------------------------+ | Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3421 | | Klinikum Grosshadern | FAX : +49-89-7095-8886 | | 81366 Munich, Germany | | +----------------------------+-------------------------------------------+