Re: Using AND in query

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Using AND in query
Дата
Msg-id i3lrov$d5e$1@dough.gmane.org
обсуждение исходный текст
Ответ на Re: Using AND in query  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
Alban Hertroys wrote on 08.08.2010 10:46:
> On 7 Aug 2010, at 23:18, Thomas Kellerer wrote:
>
>> Or as an alternative:
>>
>> SELECT tid, purchase_date
>> FROM orders
>> WHERE item in ('Laptop', 'Desktop')
>> GROUP BY tid, purchase_date
>> HAVING count(*) = 2
>
>
> This one is incorrect, it will also find people who bought two laptops or two desktops on the same date.

Right. I didn't think about that ;)

> But I think David's solution is more readable, as it leaves the item names in tact.

I absolutely agree. Another example of PG's cool array handling :)

Regards
Thomas



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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Using AND in query
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Howto only select secific lines from a result?