From: | "Mark G(dot) Franz" <mgfranz(at)pe(dot)net> |
---|---|
To: | "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Grab data WHERE table.ID NOT LIKE otherTable.ID |
Date: | 2001-07-10 23:21:27 |
Message-ID: | 01b101c10997$1189a6b0$6401a8c0@mgflaptop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Yup! This is what I ended up using, (couldn't retract my email fast
enough...);
<% rs = st.executeQuery("SELECT DISTINCT CustomerID, Username, Password,
Email FROM Customer WHERE NOT EXISTS (SELECT Registration.CustomerID WHERE
(Registration.CustomerID = Customer.CustomerID)) ORDER BY CustomerID"); %>
Thanks!
----- Original Message -----
From: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Mark G. Franz" <mgfranz(at)pe(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, July 10, 2001 4:10 PM
Subject: Re: [GENERAL] Grab data WHERE table.ID NOT LIKE otherTable.ID
>
> On Fri, 6 Jul 2001, Mark G. Franz wrote:
>
> > Here is my SQL;
> >
> > "SELECT Registration.CustomerID, Customer.CustomerID AS CustID,
Firstname,
> > Lastname, Username, Password, Question, Answer, Email, Age, Gender,
Address,
> > City, State, Zip FROM Customer, Registration WHERE Customer.CustomerID
NOT
> > LIKE Registration.CustomerID"
> >
> > I'm trying to return all the records from Customer that have not
registered
> > in Registration, so the psuedo sql would read;
> >
> > Return everything from all fields in Customer where the ID is NOT in the
> > Registration table. Any ideas?
>
> Maybe:
> select ... from Customer where NOT EXISTS (Select * from
> Registration where Customer.CustomerID LIKE Registration.CustomerID)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-07-10 23:28:19 | Re: Bad news for Open Source databases, acording to survey |
Previous Message | Mikheev, Vadim | 2001-07-10 23:18:36 | RE: Re: MVCC article |