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

Why is sql important?

1097


Explain the difference in execution of triggers and stored procedures?

1013


What is an index in sql with example?

964


what is a view? : Sql dba

1071


Explain raise_application_error.

1085


What is the difference between clustered and non-clustered index in sql?

1005


What is varchar example?

1022


What are transaction and its controls?

1033


Where can I learn sql for free?

980


Mention what plvcmt and plvrb does in pl/sql?

1130


How do I start sql from command line?

1015


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

991


explain mysql aggregate functions. : Sql dba

980


what are the t string functions available in tsql? : Transact sql

1001


what is recursive stored procedure? : Sql dba

977