Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Need to get specific value

Muzokh FrazerFeb 19 2024

Hello All

I appreciate if someone can help me out.

we have this data , see below:

Query

select 'xxx-Region B-Symmetrical 500000 Mbps-2TB Capped Internet-UBB $2.5/GB' des ,1 sq from dual
union
Select 'yyy 100 Mbps-1TB Capped Internet-UBB $2/GB-CRTC 3001.1736' ,2 from dual
union
Select '2.5/GBTetra byte -Region Z-Symmetrical 100 Mbps-2TB Capped Internet-UBB $' ,3 from dual
union
Select ' sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB $2 /GB- 3001.16' ,4 from dual
union
Select '2 GB sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB - 3001.16' ,5 from dual
union
Select 'sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB $2/ 3001.16', 6 from dual
order by 2
/

Query Result

Des SQ

xxx-Region B-Symmetrical 500000 Mbps-2TB Capped Internet-UBB $2.5/GB 1
yyy 100 Mbps-1TB Capped Internet-UBB $2/GB-CRTC 3001.1736 2
2.5/GBTetra byte -Region Z-Symmetrical 100 Mbps-2TB Capped Internet-UBB $ 3
sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB $2 /GB- 3001.16 4
2 GB sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB - 3001.16 5
sasasa A-Symmetrical 100 Mbps-1.5TB Capped Internet-UBB $2/ 3001.16 6

Desired result

2.5
2
2.5
2
2
N/A

Rules:

The system will check if there is any numeric value or values with "/GB" or "/gb" or "/ GB" or "/ gb" in the "Des" column. If yes, then it will show that value. Thanks in advance

This post has been answered by mathguy on Feb 20 2024
Jump to Answer
Comments
Post Details
Added on Feb 19 2024
4 comments
126 views