| From: | Timothy Wood <timothy(at)hallcomp(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | using CAST and LIKE |
| Date: | 2002-04-15 19:08:42 |
| Message-ID: | 1018897728.29837.21.camel@phobos |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi all,
Sorry if this has already been posted but the archives, as you probably
already know, aren't searchable right now and I did not see anything
relevant when I sifted through them. Anywho, I'm trying to use a type
cast in a where ... like select statement and I've done it like so:
SELECT * FROM table WHERE CAST('field' AS TEXT) LIKE '%value%';
now the field I'm casting, be it already of type text or not, never
returns any rows. However if I use a field that is already of text type
and do not cast it then I get resluts. So my question is is there any
way to use CAST and LIKE together in the same select or am I
missing/doing something wrong? Thanks.
Timothy,
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nigel J. Andrews | 2002-04-15 19:09:10 | Re: psql and passwords |
| Previous Message | Tom Lane | 2002-04-15 19:04:17 | Re: User-Defined Datatypes |