pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zac <zaccheob@inwind.it>
To: pgsql-sql@postgresql.org
Subject: Re: ORDER records based on parameters in IN clause
Date: Wed, 29 Jun 2005 14:12:07 +0200
Message-ID: <d9u38g$1ao3$2@news.hub.org> (raw)
In-Reply-To: <d9u33p$1ao3$1@news.hub.org>
References: <BBA4F47BB0CEDD4D8ADD2FE21E2823673110A4@dhost002-37.dex002.intermedia.net>
	<d9u33p$1ao3$1@news.hub.org>

> 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



view thread (16+ messages)  latest in thread

Message-ID: <d9u38g$1ao3$2@news.hub.org>
Permalink:  ../d9u38g$1ao3$2@news.hub.org/
Also on:    postgresql.org/message-id/d9u38g$1ao3$2@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zaccheob@inwind.it
  Subject: Re: ORDER records based on parameters in IN clause
  In-Reply-To: <d9u38g$1ao3$2@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox