Toad World® Forums

CONTAINS clause

hello all,

Here’s an easy question im still trying to find the answer for on the web, but I thought posting here might be quicker.

Im writing a query and I want to write a WHERE clause for a field and pull out every instance of the word “water.”

So let’s say the field is A.Description…how would the code look?

WHERE A.Description CONTAINS ‘water’?? Im just not sure…

Thanks in advance!

Mike

select * from dba_tab_columns where upper(column_name) like ‘%WATER%’

Case matters. ‘WATER%’ means it has to start with the word water.

Yea, I was playing around with that idea. Perfect, you answered my question.

Thanks!

Mike

Hey Mike – how about something like WHERE LOWER (a.description) LIKE ‘%water%’

This should get you anything that contains the word water regardless of case.

===========

Simultaneous posts. I missed that you’re looking for column names containing water. Then the above answer is the way to go. I thought you wanted a column named description and any descriptions containing water.

Message was edited by: MarkM in PA