Write a query to genarate target column.Please answer me.
Advance Thanks.

Src Tgt

Q10 Quarter to 2010
Q90 Quarter to 1990
Q80 Quarter to 1980
Q74 Quarter to 1974

Answer Posted / abhiraj

with data as (select 'Q10' as src from dual)
select
'Quarter to '||to_char((to_date('01/01/'||substr(Src,2), 'dd/mm/rrrr')),'rrrr') as "Target"
from data

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we implement rollback or commit statement in a trigger?

571


What are the types of functions in sql?

558


How do you sort in sql?

594


What is the maximum number of columns in sql table?

541


what is the bond code in materialized view?

2485






what is an extent ? : Sql dba

579


What is a delimiter in sas?

534


Is left join faster than inner join?

607


What is sql select statement?

498


What is the difference between clustered and non-clustered indexes?

595


What is exit statement?

537


What are the advantages of pl sql over sql?

539


What is the left table in sql?

513


Why is pl sql used?

520


What is forward declaration in pl sql?

583