Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

ILIKE PostgreSQL , what is that?

I am very curious! What is that? What's the different between LIKE and ILIKE? When can I use it?

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Quote from docs

The key word ILIKE can be used instead of LIKE to make the match case-insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension.

Take a look at yourself:

https://www.postgresql.org/docs/8.3/static/functions-matching.html

hi I read that link but it was kinda adv to understand does it mean that ilike is negative?

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Sorry I can't understand what do you mean? by 'adv' in your sentence and what do you mean by "ilike is negative"?

if you want examples, here is nice link explaining the difference between LIKE and ILIKE very well in my opinion

http://solaimurugan.blogspot.de/2010/07/ilike-operator-in-postgresql.html

Quote from there

ex : SELECT name FROM employee WHERE name LIKE 'AN%'

query will display only ANTRO, ANBU, ANTUN etc..

ex : SELECT name FROM employee WHERE name ILIKE 'AN%'

query will display name start with 'an' irrespective case, ANTRO, antTro, ANBU,AnTUN, ANTUN etc..