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
How to add new employee details in an employee_details table with the following details
what is table? : Sql dba
How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?
Is left join inner or outer?
What is sql and how does it work?
What are the advantages of sql? Explain
How to use boolean type in select statement?
What is package in pl sql?
What does truncate mean in sql?
What is the difference between a primary key and a unique key?
what are numeric data types? : Sql dba
What is execute immediate?
What is oracle sql developer?
What is the difference between explicit and implicit cursors in oracle?
What is a ddl command?