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
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 |
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 |
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 |
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 |
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 |
Can we use loop in sql?
What is embedded sql what are its advantages?
Is sql developer case sensitive?
Is left join inner or outer by default?
Why do we need databases?
Write a unique difference between a function and a stored procedure.
after tell procedure whole code he asked can i write the same way in a function
What is function and procedure in pl sql?
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.
What are the two parts of design view?
Can primary key be changed?
What is Highwatermark?