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

What are tables in sql?

671


What is a sql profiler?

699


What is the use of function in sql?

673


What is cost in sql execution plan?

625


What does over partition by mean in sql?

653






Does sql between include endpoints?

681


What is the difference between stored procedure and view?

675


what does the t-sql command ident_current does? : Transact sql

668


Enlist some predefined exceptions?

734


What is difference between pls_integer and integer?

635


Does sql profiler affect performance?

668


what is isam? : Sql dba

698


how to write date and time literals? : Sql dba

649


Is the primary key an index?

718


How to run sql statements with oracle sql developer?

726