Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5KGvia99300 for ; Wed, 20 Jun 2001 12:57:44 -0400 (EDT) (envelope-from pgsql-general-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5DFx7E75075 for ; Wed, 13 Jun 2001 11:59:07 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f5DFXpS37963 for pgsql-general@postgresql.org; Wed, 13 Jun 2001 11:33:51 -0400 (EDT) (envelope-from news) From: "postgres" X-Newsgroups: comp.databases.postgresql.general, comp.databases.postgresql.questions Subject: Re: ORDER BY what? Date: Wed, 13 Jun 2001 11:34:40 -0400 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 35 Message-ID: <9g814s$1528$1@news.tht.net> References: <01061111193103.29653@bugs> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-general@postgresql.org X-Archive-Number: 200106/741 X-Sequence-Number: 11241 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" 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