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 / vijay sultampur

For 1,3,5,7...

select * from emp where (rowid,1) in (select rowid,mod
(rownum,2) from emp);

For 2,4,6,8,...

select * from emp where (rowid,0) in (select rowid,mod
(rownum,2) from emp);

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a cursor, index in sql?

1012


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2319


Explain the functionalities that views support?

1038


What is Lock table in SQL?

1406


what are cursors? : Sql server database administration

989


How to turn on the mssql api module in php?

1010


Can we take the full database backup in log shipping?

898


What is store procedure?

1002


Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio

854


Explain how to maintain a fill factor in existing indexes?

926


Tell me what are the advantages of using stored procedures?

944


Which data type columns are the best candidates for full-text indexing?

916


What is stored procedures?

954


What are the restrictions applicable while creating views? : SQL Server Architecture

978


Can one drop a column from a table?

963