Home All Groups Group Topic Archive Search About

Small problem with NOT EXISTS...

Author
14 Sep 2006 4:28 PM
kollatjorva
How to use NOT EXiSTS

Hi
I have one stupid problem, which i've spent way to much time on


Hi all
I have this table


guid      datecreated    account      dateremoved
5DC40536  1.8.2006  9574DAAD    30.8.2006
A89B5B69  17.7.2006 FD20B38C    17.7.2006
2B9FD838  30.5.2006 BEB49691     14.9.2006
6C2B8DFA  17.7.2006 FD20B38C    17.7.2006
C0BAB1A4  17.7.2006 FD20B38C    17.7.2006
0CD9AF9D  17.7.2006 FD20B38C    17.7.2006
4B1A315E  30.8.2006 9574DAAD    30.8.2006
64379E19  30.8.2006 9574DAAD    null
91A5CD4C  14.9.2006 BEB49691    14.9.2006
9B70851C  14.9.2006 BEB49691    14.9.2006

The data I want is the accounts which has not a null in dateremoved,
that means, just the accounts that has an entry in the dateremoved
field ( here accounts FD20B38C and BEB49691)
I'm using this
SELECT account
FROM   packages
WHERE  (NOT EXISTS
        (SELECT account
         FROM packages
         WHERE (dateremoved IS NULL)))

And this does not do anything for me...

Can any one of you geniuses help me with this?
Thanks

AddThis Social Bookmark Button