Re: ORDER BY what?

From: "postgres" <harry(at)iobion(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: ORDER BY what?
Date: 2001-06-13 15:34:40
Message-ID: 9g814s$1528$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Try to give a alias of the value and order by the alias:

select count(spotted_gene_id) as bbb from spot_nav_simple group by
spotted_gene_id order by bbb desc limit 10;

Hope this is what you ask for.

"Martn Marqus" <martin(at)bugs(dot)unl(dot)edu(dot)ar> wrote in message
news:01061111193103(dot)29653(at)bugs(dot)(dot)(dot)
> I have a quite complex select query on postgres (obviously :-) ) using PHP
> (which is not the problem at the moment) which has some text searches
using
> LIKE.
> My question is: "How can I write an ORDER BY statment so that it's ordered
by
> the amount of matches it gets?"
> Is this posible without getting ichy with the programing?
>
> Saludos.... :-)
>
> --
> Cualquiera administra un NT.
> Ese es el problema, que cualquiera administre.
> -----------------------------------------------------------------
> Martin Marques | mmarques(at)unl(dot)edu(dot)ar
> Programador, Administrador | Centro de Telematica
> Universidad Nacional
> del Litoral
> -----------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message BELLON Michel 2001-06-13 15:34:55 Compilation of contrib of postgresql 7.1.2 with cygwin 1.3.2
Previous Message Tom Lane 2001-06-13 15:26:38 Re: Re: Does PostgreSQL support EXISTS?

Browse pgsql-sql by date

  From Date Subject
Next Message Lamar Owen 2001-06-13 15:35:51 Re: Re: [SQL] ORDER BY what?
Previous Message Bruno Wolff III 2001-06-13 14:57:02 Re: [SQL] ORDER BY what?