Re: PostgreSQL Query
| From: | David Robley | Date: | Fri, 21 Jul 2000 07:23:49 +0000 |
| Subject: | Re: PostgreSQL Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7529@lists.php.net to get a copy of this message | ||
On 20 Jul, Andrew wrote:
> I have this query in PostgreSQL (send from PHP) where I would like to find
> all people named "James", "james", "jAmes" but not
> "Jamesson" or something
> like that.
>
> The query "select * from table where name='james'" only returns james...
> not
> James.
> the query "select ¨* from table where name like 'James' doesn't return
> anything while select * from table where name like 'james%' returns too
> much.
>
> how should I do it?
>
> Thx for your answer!
Well, if LIKE doesn't want to behave and do a case insensitive match,
you could try using sql_regcase to force it.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA