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 is myisam? : Sql dba
What is identity column in sql server?
Is there a 64 bit version of ssms?
What is meant by <> in sql?
what is a field in a database ? : Sql dba
Explain table and field in sql?
How to start oracle sql developer?
What is bitemporal narrowing?
Which version of sql do I have?
Define implicit and explicit cursors.
what is the stuff function and how does it differ from the replace function? : Sql dba
what are the system privileges that are required by a schema owner (user) to create a trigger on a table?
How do I count rows in sql query?
Which sql most popular?
Can a table contain multiple primary key’s?