suga
suga

Reputation: 155

Separate sql value from one field

I have this:

          **value**
S:581930640 | P:581930640

And I would like to get the value as in Oracle:

**valuaA           ValueB**
 581930640       581930640

Upvotes: 0

Views: 73

Answers (1)

Shann
Shann

Reputation: 690

select  
case 
when field like 's:%'  
then substr(field,3,13) 
else  null
end as A,
case 
when field like 's:%'  
then substr(field,17) 
else  null
end as B
from table;

both the case condition are same, but the substring is different, this should do what you are trying to do.

Upvotes: 1

Related Questions