Sai Reddy

Sai Reddy

  • 1.7k
  • 201
  • 9.7k

Case with like operator

Sep 19 2019 7:33 AM
I have a column called queue_name  with following values.
 
 
[Ads] [dddd] Polit Classification US - Ad add level
[Ads] [dddd] Political Classification US - Ad add level
[Ads] [Proactive] Political Classification US - Body (Dark Mode) unknown
 
 if column has - Ad then status as 'add level' else 'unknown'
 
i tried it as follows.
 
select (case when queue_name like '%- Ad%' then "ADLEVEL" else "COMPLEVEL" end) FROM table
 
i got the following error.
 
Column 'adlevel' cannot be resolved 

Answers (4)