Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5DEQcE29805; Wed, 13 Jun 2001 10:26:39 -0400 (EDT) (envelope-from martin@bugs.unl.edu.ar) Received: by bugs.unl.edu.ar (Postfix, from userid 1004) id 630642AB3C; Wed, 13 Jun 2001 11:26:55 +0300 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: =?iso-8859-1?q?Mart=EDn=20Marqu=E9s?= To: Bruno Wolff III Subject: Re: [SQL] ORDER BY what? Date: Wed, 13 Jun 2001 11:26:54 +0300 X-Mailer: KMail [version 1.2] Cc: David Olbersen , pgsql sql Mailing List , pgsql-general@postgresql.org References: <01061215532200.04895@bugs> <20010613081656.A20924@wolff.to> In-Reply-To: <20010613081656.A20924@wolff.to> MIME-Version: 1.0 Message-Id: <01061311265400.08685@bugs> Content-Transfer-Encoding: 8bit X-Archive-Number: 200106/468 X-Sequence-Number: 10921 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@unl.edu.ar Programador, Administrador | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------