This is a discussion on Where clause... within the pgsql Novice forums, part of the PostgreSQL category; --> Hello, I have a table which a column "fee_type " declared as char(1) The column can contain 'I' (uppercase ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I have a table which a column "fee_type " declared as char(1) The column can contain 'I' (uppercase i), 'C' or 'R' When querying with Select * from <table> where fee_type in ('I', 'C') the query returns nothing. The query returns the rows I am expecting when doing one of the following: where fee_type ilike ('I') or fee_type ilike ('C') or where fe.fee_type = chr(73) or fee_type = chr(67) (this proves the value is indeed uppercase) but nothing is returned either when I try where fee_type like ('I') or fee_type like ('C') I thought it would be related to the datatype so I tried casting the 'I' and 'C' to char(1), but I had no luck. Could you give me a hint ? thanks Didier ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate |
| ||||
| am Sun, dem 03.02.2008, um 9:26:34 +0100 mailte Didier Gasser-Morlay folgendes: > Hello, > > I have a table which a column "fee_type " declared as char(1) > > The column can contain 'I' (uppercase i), 'C' or 'R' > > When querying with Select * from <table> where fee_type in ('I', 'C') > > the query returns nothing. Works for me: test=*# select * from fee; id | fee_type ----+---------- 1 | C 2 | I 3 | c 4 | i 5 | a (5 rows) test=*# select * from fee where fee_type in ('C','I'); id | fee_type ----+---------- 1 | C 2 | I (2 rows) Please show us your table description (\d table like test=*# \d fee Table "public.fee" Column | Type | Modifiers ----------+--------------+----------- id | integer | fee_type | character(1) | and tell us your PG-Version. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |