Can anyone tell the query for the below scenario

Input:

Col1 Col2
DBA Stored Procedure
DBA Functions
DBA Triggers

Output:

Col1 Col2
Stored Procedure
DBA Functions
Triggers

>Solution :

select
     case when substring(Col2,2,1)='u' then 'DBA' else '' end as Col1
    ,Col2
from yourtable

Leave a Reply