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

Can foreign key be duplicate?

1002


How to download and install the scaled-down database adventureworkslt?

957


Explain about SQL server 2005?

922


What are Spatial data types in SQL Server 2008

969


What is the difference between join and inner join?

955


How much does sql server 2016 cost?

991


what are the new features in SSRS?

127


Do you know what is similarity and difference between truncate and delete in sql?

963


How to list all user names in a database?

1008


What is sql sandbox in sql server?

1149


What is difference between delete & truncate commands?

1025


Tell me what is the order in which the sql query is executed?

902


What are system databases in ms sql server?

968


Explain about thread and memory management process of SQL?

925


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

966