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

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -