Fw: It worked! Was :Re: Select Statement Hang...
Fw: It worked! Was :Re: Select Statement Hang...
От:
"Chad Thompson" <chad@weblinkservices.com>
Дата:
----- Original Message ----- From: "ttzhang" To: "Chad Thompson" Sent: Monday, July 21, 2003 7:09 PM Subject: It worked! > I got the two table names wrong. :) > > This one also works: > > Thank you so much! > > >===== Original Message From "Chad Thompson" ===== > >I forgot that I usually link the tables in the sub select. > > > >select id > >from btable b > >where not exists > >(select id > >from atable a > >where a.id = b.id) > > > >Hope that helps > >Chad > > > >----- Original Message ----- > >From: "ttzhang" > >To: > >Sent: Sunday, July 13, 2003 2:49 PM > >Subject: [NOVICE] Select Statement Hang... > > > > > >> I was trying to set up a foreign key for an id field but found out that > >some > >> of the ids are not in the referenced table. To look things up, I tried > >> > >> select id from btable where id not in (select id from atable) > >> > >> The query just hang..... My tables are pretty big (200, 000?) can anyone > >> help me to pinpoint the problem? > >> > >> Thanks! > >> > >> > >> > >> ---------------------------(end of broadcast)--------------------------- > >> TIP 5: Have you checked our extensive FAQ? > >> > >> http://www.postgresql.org/docs/faqs/FAQ.html > >> > > >