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 * ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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> > |
| |||
| 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 |
| ||||
| 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 |