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 are the join types in tsql? : Transact sql

981


What problem one might face while writing log information to a data-base table in pl/sql?

1066


What are basic techniques of indexing?

1320


What are sql injection vulnerabilities?

909


What is a stored procedure in sql with example?

1053


what is the use of friend function? : Sql dba

971


What is the requirement of self-join?

1025


How does a self join work?

990


What is the purpose of the primary key?

1005


what is the difference between a web-garden and a web-farm? : Sql dba

1010


what is the difference between inner and outer join? Explain with example. : Sql dba

971


Write a sql query to convert all character to uppercase after hypen.

1376


What is a data definition language?

1027


Can we join 3 tables in sql?

955


Can we call procedure in select statement?

974