Re: ORDER records based on parameters in IN clause

From: Zac <zaccheob(at)inwind(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER records based on parameters in IN clause
Date: 2005-06-29 12:12:07
Message-ID: d9u38g$1ao3$2@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> SELECT
> table.*
> FROM
> table
> JOIN (SELECT id, count(id) AS count FROM... your subquery) AS x
> ORDER BY
> x.count
>
> Bye.
Sorry: I forgot join condition:
SELECT
table.*
FROM
table
JOIN (SELECT id, count(id) AS count FROM... your subquery) AS x ON
(table.id = x.id)
ORDER BY
x.count

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message KÖPFERL Robert 2005-06-29 12:40:08 Re: ENUM like data type
Previous Message Zac 2005-06-29 12:09:35 Re: ORDER records based on parameters in IN clause