Link to home
Start Free TrialLog in
Avatar of jramos74
jramos74

asked on

Construct a SELECT query

How do I construct a SELECT query with a WHERE CLAUSE?
For example:
I want to find all records with columnname that has an apple word in it.
I know this query is wrong.
SELECT * FROM TABLE1 WHERE COLUMNNAME is in ('APPLE TART', 'apple', 'apple pie', 'Candy Apple');

Avatar of bolt81
bolt81
Flag of United Kingdom of Great Britain and Northern Ireland image

SELECT * FROM table1 WHERE columnname LIKE '%apple%'

tutorial linked below
http://www.techonthenet.com/sql/like.php 
Avatar of jramos74
jramos74

ASKER

Does the case format matter?  Will this query pull records with 'APPLE' too?
which version are you using?

you can use ILIKE if you are using version 10g
Can you give me a select statement using ilike?  I tried it and it did not work.  We have 10g.  My query is SELECT * FROM TABLE1 where columnname ilike '%apple%' and it did not work.
ASKER CERTIFIED SOLUTION
Avatar of bolt81
bolt81
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial