sql - case statement with expression throws error -


this question has answer here:

i trying execute below statement in oracle, throws error. kindly help.

select a.phone_number,  case a.phone_number when '2262070200' '2262070200' when a.phone_number = '2262070201' or a.phone_number = '2262070202' '2nd' end temp_a a; 

error :

ora-00905: missing keyword

data in temp_a

2262070200 2262070201 2262070202 2262070203 2262070204 2262070205 2262070206 2262070223 2262070224 2262070225 

your query should this

select a.phone_number,  case  when a.phone_number = '2262070200' '2262070200' when a.phone_number = '2262070201' or a.phone_number = '2262070202' '2nd' end temp_a a; 

Comments

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -