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 / leo

with contactinfo as (
select contactid,firstname,row_number() over (order by
firstname)as row from person.contact
)
--select * from contactinfo where row % 2 =0

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is inner join in sql server joins?

1100


What are the differences between having and where clause.

1023


How many types of dimensions are there and what are they? : sql server analysis services, ssas

1121


What is the primary use of the model database?

1133


What is the difference between a fill factor of 100 and 0?

1032


What is NOT NULL Constraint in sql server 2012?

1047


What is dbcc updateusage?

1258


What is partition in sql server?

1097


What is a partitioned view?

1053


Can you name some of the dml commands in sql?

1085


What is conditional split?

1141


What are the disadvantages of using querystrings to send data from one page to another?

1073


What is a non-clustered index?

1046


What is the difference between migration and upgradation in sql server?

1138


How to restore performance issues and how to check?

2060