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 are the join types in tsql? : Transact sql
What problem one might face while writing log information to a data-base table in pl/sql?
What are basic techniques of indexing?
What are sql injection vulnerabilities?
What is a stored procedure in sql with example?
what is the use of friend function? : Sql dba
What is the requirement of self-join?
How does a self join work?
What is the purpose of the primary key?
what is the difference between a web-garden and a web-farm? : Sql dba
what is the difference between inner and outer join? Explain with example. : Sql dba
Write a sql query to convert all character to uppercase after hypen.
What is a data definition language?
Can we join 3 tables in sql?
Can we call procedure in select statement?