Re: [SQL] select a part of a name

From: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: <kaiq(at)realtyideas(dot)com>, "Vladimir Terziev" <vlady(at)school(dot)digsys(dot)bg>
Cc: "Fred Schoonewille" <schoonewille(at)coh(dot)fgg(dot)eur(dot)nl>, <pgsql-sql(at)hub(dot)org>
Subject: Re: [SQL] select a part of a name
Date: 1999-12-08 16:50:34
Message-ID: 003401bf419c$58826f30$760e01a3@oucs.ox.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> use: where name like '%names%'

Except that the user specified he wanted to be able to find Tom Jones
and jonas from the search text jon, so you either need to use:

where lower(name) like ('%' ¦¦ lower(searchtext) ¦¦ '%')

or something similar, which is slow unless you have an index on
lower(name), and even then.
Or you use the regexp search ~* given previously.

----------------------------------------------------------------------
----------------
Moray(dot)McConnachie(at)computing-services(dot)oxford(dot)ac(dot)uk

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John C Cusick 1999-12-08 17:16:15 Re: [SQL] Getting last used oid
Previous Message kaiq 1999-12-08 15:47:51 Re: [SQL] select a part of a name