Unix Technical Forum

Non case sensitive

This is a discussion on Non case sensitive within the pgsql Novice forums, part of the PostgreSQL category; --> Is there a way that select's where clause can be used as insensitive to thecase? I mean: "SELECT * ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:06 PM
roy simkes
 
Posts: n/a
Default Non case sensitive

Is there a way that select's where clause can be used as insensitive to thecase? I mean:
"SELECT * FROM table WHERE field LIKE 'f' " will return every row that field begins with a "f" or a "F". Without writing " field LIKE 'f' OR field LIKE 'F' " of course.

Thanks
__________________________________________________ _______________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:06 PM
Shoaib Mir
 
Posts: n/a
Default Re: Non case sensitive

You can use a contrib module "citext" (
http://gborg.postgresql.org/project/...rojdisplay.php) for that
purpose.

Thanks,
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 8/14/06, roy simkes <roysimkes@hotmail.com> wrote:
>
> Is there a way that select's where clause can be used as insensitive to
> the case? I mean:
> "SELECT * FROM table WHERE field LIKE 'f' " will return every row that
> field begins with a "f" or a "F". Without writing " field LIKE 'f' OR field
> LIKE 'F' " of course.
>
> Thanks
>
> ------------------------------
> Express yourself instantly with Windows Live Messenger! Windows Live
> Messenger!<http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=joinmsncom/messenger>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 11:06 PM
Sean Davis
 
Posts: n/a
Default Re: Non case sensitive




On 8/14/06 8:57 AM, "roy simkes" <roysimkes@hotmail.com> wrote:

> Is there a way that select's where clause can be used as insensitive to the
> case? I mean:
> "SELECT * FROM table WHERE field LIKE 'f' " will return every row that field
> begins with a "f" or a "F". Without writing " field LIKE 'f' OR field LIKE 'F'
> " of course.


Use ILIKE instead of LIKE?

Sean


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 11:06 PM
Brendon Gleeson
 
Posts: n/a
Default Re: Non case sensitive

roy simkes wrote:
> Is there a way that select's where clause can be used as insensitive to

the case? I mean:
> "SELECT * FROM table WHERE field LIKE 'f' " will return every row that

field begins with a "f" or a "F". Without writing " field LIKE 'f' OR field
LIKE 'F' " of course.


try:
"SELECT * FROM table WHERE LOWER(field) LIKE 'f'"

or:
"SELECT * FROM table WHERE LOWER(field) LIKE LOWER(x)" <-- if using
variable "x"

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:51 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com