Re: Quetions on Joins
От
Stephan Szabo
Тема
Re: Quetions on Joins
Дата
Msg-id
20030831111037.K94333-100000@megazone.bigpanda.com
Ответ на
Quetions on Joins (Alex)
Список
Дерево обсуждения
Question Join/Subselect Alex <alex@meerkatsoft.com>
Re: Question Join/Subselect "Andrew L. Gould" <algould@datawok.com>
Re: Question Join/Subselect Alex <alex@meerkatsoft.com>
Re: Question Join/Subselect "Andrew L. Gould" <algould@datawok.com>
Quetions on Joins Alex <alex@meerkatsoft.com>
Re: Quetions on Joins Ron Johnson <ron.l.johnson@cox.net>
Re: Quetions on Joins Alex <alex@meerkatsoft.com>
Re: Quetions on Joins Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Question Join/Subselect Richard Huxton <dev@archonet.com>
Re: Question Join/Subselect Alex <alex@meerkatsoft.com>
On Mon, 1 Sep 2003, Alex wrote: > Hi, > > I have a query where I want to filter out records from table_a if a > field in table_a matches in table table_b. Basically table_b defines the > filter. Well something like one of the following should work depending on how you want to treat nulls and such (and performance varies in postgresql by version for each of the options): SELECT a.value_one FROM table_a AS A where NOT EXISTS (select 1 from table_b AS B WHERE A.value_two=B.value_two); SELECT a.value_one FROM table_a AS A where A.value_two NOT IN (select value_two from table_b); SELECT a.value_one FROM table_a AS A LEFT OUTER JOIN table_b AS B ON (a.value_two=B.value_two) WHERE B.value_two IS NULL;
В списке pgsql-general по дате отправления