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 is the difference between count(*) and count(1) ?

1125


Define self join?

1077


What is the function of inner join?

1125


What is Dependency Injection and provide example?

1178


What is set nocount on?

993


how to create “alternate row colour”?

152


How to create function without parameter in sql server?

1105


What are the differences between decimal and float in ms sql server?

1344


What is inline variable assignment?

1080


Can you explain what are the restrictions applicable while creating views? : SQL Server Architecture

960


What is the status of services on passive node for failover cluster in sql server? : sql server database administration

1346


What is user-defined functions? What are the types of user-defined functions that can be created?

1078


What happens if we shrink log file in sql server?

1030


What types of replication are supported in sql server?

1112


What are wait types?

1198