List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:June 27 1999 11:09pm
Subject:Re: Rewriting of subselect query
View as plain text  
On So, 1999-06-27 21:57:50 +0200, Tor-Erik Hagen wrote:
> Can anyone give a good rewrite of this one:
> 
> select * from KundeInteresse where K_ID not in(select K_ID from KundeInteresse where
> I_ID=0);

Hmm, you want I_ID not to be 0?

SELECT  *
FROM    KundeInteresse
WHERE   I_ID <> 0
     OR I_ID IS NULL;

Or maybe

SELECT  *
FROM    KundeInteresse
WHERE   IFNULL(I_ID, 1) <> 0;
        
Does this help?

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
Rewriting of subselect queryTor-Erik Hagen27 Jun
  • Re: Rewriting of subselect queryMartin Ramsch28 Jun
  • SV: Rewriting of subselect queryTor-Erik Hagen28 Jun
    • Query Optimization ProblemBrian Bray28 Jun
      • Re: Query Optimization ProblemJim Faucette28 Jun
      • Re: Query Optimization ProblemChristian Mack15 Jul