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

What are triggers? How do you invoke a trigger on demand?

1240


How to disable triggers using "disable trigger"?

999


Does partitioning ssd reduce performance?

845


What is the difference between stored procedure and user defined functions?

1125


What is user defined stored procedures?

876


What are the encryption mechanisms in sql server?

967


How to scale out a federation by Sql statement?

116


What is a mutating table error and how can you get around it?

964


Difference between aggregate functions of sql?

1037


can you implement data mining in SSRS?

140


How to create an inline table-valued function?

906


Is BCNF better than 2NF & 3NF? Why?

1002


How to create a view on an existing table in ms sql server?

1051


How to define and use table alias names in ms sql server?

1041


Why Master database is required?

1057