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 the difference between unique and primary key constraints?

666


Explain the difference in execution of triggers and stored procedures?

661


What is user defined functions?

671


Does access use sql?

663


Is primary key clustered index?

603






How many columns should be in an index?

615


Why is stored procedure faster than query?

581


What is primary key and foreign key with example?

580


What are sql functions? Describe the different types of sql functions?

636


Why are indexes and views important to an organization?

602


Is it possible to create the following trigger: before or after update trigger for each row?

822


What is the difference between join and natural join?

563


What is the use of partition by in sql?

614


how to drop an existing view in mysql? : Sql dba

693


What is pl sql package?

692