Re: Weird NOT IN effect with NULL values

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Weird NOT IN effect with NULL values
Дата
Msg-id 200103012046.PAA19437@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Weird NOT IN effect with NULL values  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-sql
> SELECT name
> FROM customer
> WHERE NOT EXISTS (
> SELECT customer_id
> FROM salesorder
> WHERE customer_id = customer.customer_id
> );
> 
> Bruce, you may want to consider editing your next edition to include the
> above modification.  WHERE ... NOT IN is a bad idea for any subselect on
> medium-large tables.

FAQ item mentions this, and section 8.2 shows eqivalency at the end of
the section.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Weird NOT IN effect with NULL values
Следующее
От: "Martin A. Marques"
Дата:
Сообщение: Re: why the DB file size does not reduce when 'delete' the data in DB?