Write the sql query using dual table for below output?
1 L R
--- --- ----
1 1 1
1 2 1
1 3 1
1 1 2
1 2 2
1 3 2
1 1 3
1 2 3
1 3 3
Write a query using only Dual table with out writing any pl/sql program.
Answer Posted / shailesh
select 1 as "1", decode(mod(level,3), 0, 3, mod(level,3))as l,
case
when level<=3 then 1
when level>3 and level <7 then 2
else
3
end as r
from dual connect by level<10;
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What trigger means?
What are database links used for?
What is the advantage of index in sql?
What is recursive stored procedure?
What is the primary key?
What is the difference between jpql and sql?
How do you rename a table in sql?
What is pl sql script?
Why should I use postgresql?
what are the differences among rownum, rank and dense_rank? : Sql dba
Explain exception handling in pl/sql?
What is union and union all keyword in sql and what are their differences?
what is try_catch block in procedure
What is %s in sql?
What does the file extension accdb stand for?