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

How can we make an if statement within a select statement?

1061


Why select is used in sql?

1068


How many types of cursors are available in pl/sql?

1157


Who developed sql?

1091


What is a composite primary key?

1140


What is clause?

1224


What is the importance of sqlcode and sqlerrm?

1389


Is sql between inclusive?

1193


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

1133


i have some prob lem to tell me about my self in interview first round ...

2213


What is the best free sql database?

1100


What is on delete restrict?

1066


What are the advantages of indexing?

1023


What are the types of variable use in pl sql?

1132


The in operator may be used if you know the exact value you want to return for at least one of the columns.

1221