Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is hadoop a nosql?

982


How do you modify a trigger?

913


What is coalesce in sql?

1034


What is loop in pl sql?

1018


What is the difference between delete and truncate commands?

1018


how to use myisamchk to check or repair myisam tables? : Sql dba

956


Which type of cursor is used to execute the dml statement?

940


What are the two virtual tables available at the time of database trigger execution?

1198


What is the current version of postgresql?

1044


What is the most important ddl statements in sql are?

979


Is sql a backend language?

1073


How does left join work in sql?

983


what are the different index configurations a table can have? : Sql dba

980


what is the difference between delete and truncate statement in sql? : Sql dba

1210


how to shutdown mysql server? : Sql dba

1077