2021年1月4日星期一

Convert String to char in oracle

Hi i have the following data '1,2,3' and i need to convert this into this '1','2','3' that i will use in this

Select * from dual where to_chat(month) in ('1','2','3')  

i cannot use query straight like that because of the quater

Quater no.    Month  1             1,2,3  2             4,5,6  ...    

so i must use case like this but case statement return on format like this '1','2','3'

 Select * from dual   where to_chat(month) in (  select   case quarter   when 1 then '1','2','3'   when 2 then '4','5','6'   end   from dual )  

input

'1,2,3'  

expected output

'1','2','3'  
https://stackoverflow.com/questions/65571894/convert-string-to-char-in-oracle January 05, 2021 at 09:05AM

没有评论:

发表评论