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
Is hadoop a nosql?
How do you modify a trigger?
What is coalesce in sql?
What is loop in pl sql?
What is the difference between delete and truncate commands?
how to use myisamchk to check or repair myisam tables? : Sql dba
Which type of cursor is used to execute the dml statement?
What are the two virtual tables available at the time of database trigger execution?
What is the current version of postgresql?
What is the most important ddl statements in sql are?
Is sql a backend language?
How does left join work in sql?
what are the different index configurations a table can have? : Sql dba
what is the difference between delete and truncate statement in sql? : Sql dba
how to shutdown mysql server? : Sql dba