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 / megha

select
'Quarter to '||to_char((to_date('01/01/'||substr(Src,2), 'dd/mm/rrrr')),'rrrr') as "Target"
from table

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlservr exe?

482


What are aggregate functions in sql?

633


What is set serveroutput on?

646


What is a primary key? Explain

545


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

722






Show how functions and procedures are called in a pl/sql block.

588


how to enter binary numbers in sql statements? : Sql dba

493


what is oltp (online transaction processing)? : Sql dba

537


Can a key be both primary and foreign?

510


what is schema? : Sql dba

564


Explain the difference between cursor declared in procedures and cursors declared in the package specification?

579


How to get list of all tables from a database?

631


What is difference between table and view?

530


Is oracle and sql same?

577


Is left join and outer join same?

552