Re: Group by with insensitive order

From: Aram Fingal <fingal(at)multifactorial(dot)com>
To: Postgres-General General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Group by with insensitive order
Date: 2011-01-19 22:17:51
Message-ID: E54B78F6-274B-4D5D-97E9-2A4498C195A3@multifactorial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> Easy way is something like
>
> SELECT LEAST(drug1, drug2), GREATEST(drug1, drug2), AVG(response)
> FROM data
> GROUP BY 1, 2
>
> though it'd be a PITA to scale that to more than 2 drugs.
>
> regards, tom lane

Thanks, Tom and Hubert, who said the same thing. For the foreseeable future, two drug combos are all we're going to be doing. That's bad enough with over 8000 combos of two.

-Aram

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2011-01-19 22:20:35 Re: How to fire triggers just on "top" level DML
Previous Message Adrian Klaver 2011-01-19 22:11:49 Re: How to fire triggers just on "top" level DML