Re: ILIKE Problem?

From: Darren Ferguson <darren(at)crystalballinc(dot)com>
To: "cgibbs(at)westmarkproducts(dot)com" <cgibbs(at)westmarkproducts(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ILIKE Problem?
Date: 2003-05-22 23:11:50
Message-ID: 3ECD5936.9010109@crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When you do the first one since you are not using %% values like will
treat this as = so it would have to exactly equal what you put in the
where clause. (someone correct if this is wrong but i believe it is correct)

In the second one you use the % which means it appears anywhere in the
string i.e.

%test - will return test, atest, and test would have to be the last word
in the string.

test% - will return test as the first word followed by anything else

%test% - will return any string with the text "test" in it.

test - will be the same as evlvlist = 'test'

HTH
Darren

Corey W. Gibbs wrote:

>Good Afternoon Everyone,
>
>I was wondering if I am running into a problem with ILIKE. Here is what happened:
>
>When trying to execute this select statement:
> SELECT * from elevlist WHERE fulldwgpath ILIKE '\\\\cad_svr\\someDirectory-name-thatis-long\\somefile.dwg'
>0 rows are returned, but if I shorten it to:
> SELECT * from elevlist WHERE fulldwgpath ='%somefile.dwg%'
>my rows are returned. fulldwgpath is a varchar(250) datatype.
>
>Any ideas?
>thanks in advance
>corey
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-05-22 23:33:30 Re: VACUUM and transaction ID wraparound
Previous Message Stephan Szabo 2003-05-22 23:00:54 Re: [ADMIN] Q: Structured index - which one runs faster?