Re: PostgreSQL Query
| From: | Joe Conway | Date: | Fri, 21 Jul 2000 05:48:08 +0000 |
| Subject: | Re: PostgreSQL Query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7522@lists.php.net to get a copy of this message | ||
>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.
If you want to get a case insensitive, but otherwise exact match, try using
"select * from table where upper(name)='JAMES';"
Hope this helps,
Joe