pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: postgres <harry@iobion.com>
To: pgsql-general@postgresql.org
Subject: Re: ORDER BY what?
Date: Wed, 13 Jun 2001 11:34:40 -0400
Message-ID: <9g814s$1528$1@news.tht.net> (raw)
References: <01061111193103.29653@bugs>

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





view thread (9+ messages)  latest in thread

Message-ID: <9g814s$1528$1@news.tht.net>
Permalink:  ../9g814s$1528$1@news.tht.net/
Also on:    postgresql.org/message-id/9g814s$1528$1@news.tht.net

 · 

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: harry@iobion.com, pgsql-general@postgresql.org
  Subject: Re: ORDER BY what?
  In-Reply-To: <9g814s$1528$1@news.tht.net>

* 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