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

what is myisam? : Sql dba

1091


What is identity column in sql server?

1054


Is there a 64 bit version of ssms?

965


What is meant by <> in sql?

983


what is a field in a database ? : Sql dba

1071


Explain table and field in sql?

1068


How to start oracle sql developer?

1049


What is bitemporal narrowing?

1315


Which version of sql do I have?

1068


Define implicit and explicit cursors.

1150


what is the stuff function and how does it differ from the replace function? : Sql dba

1062


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

1084


How do I count rows in sql query?

1003


Which sql most popular?

994


Can a table contain multiple primary key’s?

1108