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 / mani

WITH a as (SELECT level L from DUAL CONNECT BY level <=3)
SELECT 1, L, R
FROM (SELECT level R from DUAL CONNECT BY level <=3) b
CROSS JOIN a;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is primary key and foreign key?

529


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

713


what is the difference between union and union all? : Sql dba

542


what is the use of friend function? : Sql dba

535


what is online transaction processing (oltp)? : Sql dba

520






how to include character strings in sql statements? : Sql dba

549


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

548


What is difference between mysql and postgresql?

506


what is not null constraint? : Sql dba

544


Why sql query is slow?

576


How do I run a pl sql program?

623


What is number function in sql?

524


Explain the purpose of %type and %rowtype data types with the example?

548


What are all the different normalization?

556


What is pragma in sql?

613