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

How to count groups returned with the group by clause in ms sql server?

1070


How do you rebuild an identity column?

957


What is the maximum rows in sql server table?

921


What is stretch database in sql server?

1073


What is the difference between Triggers and Stored Procedure?

1105


What is scd (slowly changing dimension)? : sql server analysis services, ssas

1014


What is the sql case statement used for? Explain with an example?

1002


What are the options which must be set to allow the usage of optimistic models?

966


How to select an exiting database using mssql_select_db()?

995


Difference between Sql server reporting services and Crystal reports?

172


What is sleeping status in sql server?

1030


What are the main differences between #temp tables and @table variables and which one is preferred?

1089


how can you attach more than 20 ldf files in sql server

2009


What is SQL Azure Firewall?

136


Will sql server 2005 allow you to reduce the size of a column?

1001