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...

how to write the query to select the rows are in the order
of either 1,3,5,7... or 2,4,6,8,...

Answer Posted / tiru

select * from
(select emp.ename, emp.age, (rownum+1) AS XX from employee
emp )
where remainder(XX,2) = 0;

select * from
(select emp.ename, emp.age, (rownum+1) AS XX from employee
emp )
where remainder(XX,2) = 1;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are the exceptions handled in sql server programming?

1062


What is single-user mode?

933


What is view in sql?

904


Explain what are commit and rollback in sql?

931


How to use the inserted and deleted pseudo tables?

961


Why is the need for data conversion transformations?

1060


Which are the two editions in which SQL Azure database available?

119


What is format parameter in ssrs?

146


How to rename an existing column with sql server management studio?

999


Can primary key be null?

928


What is the full form of dql?

981


What options are available to audit login activity? : sql server security

1149


How to list all login names on the ms sql server?

1140


How are the unique and primary key constraints different?

1073


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

1066