Group by with insensitive order

Поиск
Список
Период
Сортировка
От Aram Fingal
Тема Group by with insensitive order
Дата
Msg-id 6DC89F55-57BA-489C-ADF9-9AF09BE1CE28@multifactorial.com
обсуждение исходный текст
Ответы Re: Group by with insensitive order
Re: Group by with insensitive order
Список pgsql-general
Suppose I'm doing a group by query like the following:

SELECT drug1, drug2, AVG(response)
FROM data
GROUP BY drug1, drug2

The problem is that the same drug may appear sometimes as drug1 and sometimes as drug2.  So, for example, the
combination"aspirin, acetaminophen" may also appear as "acetaminophen, aspirin" and I want these grouped together in
thequery.  Is there a simple way to do this? 

--Aram Fingal

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error during a dump (ts_selectivity, not found)
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: PostgreSQL 9.0.1 PITR can not copy WAL file