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

Answers were Sorted based on User's Feedback



Write a query to genarate target column.Please answer me. Advance Thanks. Src Tgt Q10 Quar..

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

Write a query to genarate target column.Please answer me. Advance Thanks. Src Tgt Q10 Quar..

Answer / ajit

select substr(src, 1,1 )||'uarter to '||to_char(to_date (substr(src, 2), 'rrrr'), 'yyyy') tgt
from <Table Name>

Is This Answer Correct ?    2 Yes 0 No

Write a query to genarate target column.Please answer me. Advance Thanks. Src Tgt Q10 Quar..

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

Write a query to genarate target column.Please answer me. Advance Thanks. Src Tgt Q10 Quar..

Answer / aditya saxena @adi

select 'Quarter to '||to_char(to_date('01/01/'||substr(months,2),'dd/mm/rrrr'),'RRRR') AS Src_Tgt from (
select 'Q10' months from dual
union all
select 'Q90' from dual
union all
select 'Q80' from dual
union all
select 'Q74' from dual
)
;

Is This Answer Correct ?    0 Yes 0 No

Write a query to genarate target column.Please answer me. Advance Thanks. Src Tgt Q10 Quar..

Answer / manohar

select 'Quarter to' ||to_char(cast('1/1/'||substr(Src) as
char),'YYYY') from table

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

Can we use loop in sql?

0 Answers  


What is embedded sql what are its advantages?

0 Answers  


Is sql developer case sensitive?

0 Answers  


Is left join inner or outer by default?

0 Answers  


Why do we need databases?

0 Answers  






Write a unique difference between a function and a stored procedure.

0 Answers  


after tell procedure whole code he asked can i write the same way in a function

3 Answers  


What is function and procedure in pl sql?

0 Answers  


How we get all_group_function's(Sum,avg,count,max and min_value of a column(Sal) Using pl/sql anonymous block, with out using group function's. You shouldn't use more than one select statement in entire the program. Like cursor c is select * from <table_name>; except this you can't use another select statement. You can use no of variables as per requirement.

1 Answers  


What are the two parts of design view?

0 Answers  


Can primary key be changed?

0 Answers  


What is Highwatermark?

3 Answers   Thermotech,


Categories