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
Why is sql important?
Explain the difference in execution of triggers and stored procedures?
What is an index in sql with example?
what is a view? : Sql dba
Explain raise_application_error.
What is the difference between clustered and non-clustered index in sql?
What is varchar example?
What are transaction and its controls?
Where can I learn sql for free?
Mention what plvcmt and plvrb does in pl/sql?
How do I start sql from command line?
what is online transaction processing (oltp)? : Sql dba
explain mysql aggregate functions. : Sql dba
what are the t string functions available in tsql? : Transact sql
what is recursive stored procedure? : Sql dba