Re: [SQL] ORDER BY what?

From: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: David Olbersen <dave(at)slickness(dot)org>, pgsql sql Mailing List <pgsql-sql(at)postgresql(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: [SQL] ORDER BY what?
Date: 2001-06-13 08:26:54
Message-ID: 01061311265400.08685@bugs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Mié 13 Jun 2001 16:16, Bruno Wolff III wrote:
> On Tue, Jun 12, 2001 at 03:53:22PM +0300,
>
> >
> > OK, let me give an example:
> >
> > select * from tab1 where col1 like '%word%' or col2 like '%word%' and
> > col3 like '%word%'
> >
> > and I want to order by the amopunt of matches that a matching register
> > has. Something like, if it matches all the ORs, then it should go first,
> > and if it matches only one of the ORs it should go last.
> > Or maybe even have several words trying to match one of the columns.
>
> You could do this by computing a value based on the number of parts
> that matched and order by it.

Could you give me a hint on this? Do I have to use PLSQL? Triggers? Something
else?

Thanks for the responce.

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
-----------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message F. Masselink 2001-06-13 08:49:49 function / trigger problem
Previous Message Stefan Loidl 2001-06-13 07:51:25 Re: Connection Timeout ?

Browse pgsql-sql by date

  From Date Subject
Next Message David BOURIAUD 2001-06-13 09:17:14 Help on a sql querry.
Previous Message Srikanth Rao 2001-06-13 02:08:19 How to store a linked list in a RDBMS