Re: ORDER BY what? - Mailing list pgsql-general

From postgres
Subject Re: ORDER BY what?
Date
Msg-id 9g814s$1528$1@news.tht.net
Whole thread Raw
In response to ORDER BY what?  (Martín Marqués <martin@bugs.unl.edu.ar>)
List pgsql-general
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.


"Mart�n Marqu�s" <martin@bugs.unl.edu.ar> wrote in message
news:01061111193103.29653@bugs...
> 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@unl.edu.ar
> Programador, Administrador      |       Centro de Telematica
>                        Universidad Nacional
>                             del Litoral
> -----------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org



pgsql-general by date:

Previous
From: junkboy@zeus.bwh.harvard.edu (holtzman)
Date:
Subject: What do you do when...? A schema Question
Next
From: "tom"
Date:
Subject: RE: Web site gripes