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 not equal in sql?
How to add, remove, modify users using sql?
What does count (*) mean in sql?
What are secondary keys?
what is the difference between myisam static and myisam dynamic? : Sql dba
Mention what are different methods to trace the pl/sql code?
How do you delete data from a table?
What is a design view?
What are local and global variables and their differences?
what is union? : Sql dba
What is the difference between distinct and unique in sql?
What are the sql aggregate functions?
What is the reports view in oracle sql developer?
What are different sql data types?
Is primary key an index?