Robblob
Robblob

Reputation: 77

How to search in a column for information that does not contain certain characters

I'm trying to limit my results in a query by ruling out certain characters. For example, Column A is always constant, but can have multiple returns in column B. I need to rule out everything in column B that contains "WWW", but I'm not excactly sure how to do it.

Upvotes: 1

Views: 48

Answers (2)

Black.Jack
Black.Jack

Reputation: 1959

add a where clause:

select x.a,x.b from foo x where x.b not like '%www%'

i you always wanna see a column then

select x.a, case when x.b not like '%www%' then b else null end from foo x

hope it helps...

Upvotes: 1

Filipe Silva
Filipe Silva

Reputation: 21657

Try using:

...
WHERE columnB NOT LIKE '%WWW%'

Upvotes: 2

Related Questions