Re: Query Help using Except

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Query Help using Except
Дата
Msg-id 20031027033443.GA11800@wolff.to
обсуждение исходный текст
Ответ на Query Help using Except  (yusuf0478@netscape.net)
Список pgsql-sql
On Thu, Oct 23, 2003 at 14:17:08 -0400, yusuf0478@netscape.net wrote:
> 
> I can't do the following, since the number of selected columns have to match: 

One option is to use where NOT EXISTS instead of EXCEPT. Another way would
be to add A.id to the rows in the set difference using a join. I expect the
second method would be slower and that you should try using NOT EXISTS.

> 
> select A.id 
>     , A.charge
>     , B.user_id
>     , C.employee_id
> from A
> inner join B using (user_id)
> inner join C using (employee_id)
> 
> except
> 
> select X.charge
>     , Y.user_id
>     , Z.employee_id
> from X
> inner join Y using (user_id)
> inner join Z using (employee_id)


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

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: index and min()
Следующее
От: Mukta Telang
Дата:
Сообщение: Unsubscribe