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 do we find every fifth record in a table

Answer Posted / saravanan p

If we consider employee2 table having 16 records like

Name Salary
Ajith 10000
Arithas 2000
Balaji 20000
Gamesh 20000
Jith 23000
keerthy 14000
boopathy 21000
moorthy 12000
Muthu Krishnan 30000
Muthu Kumar 80000
naveen 10200
neerthy 40000
Raja 12000
Ramesh 12000
sangeeth 1100
Vairam 23000


With Temp as
(
select row_number() over(order by [name]) as 'rno',
[name] from employee2
)
select [name],salary from Temp
where rno%5 = 0


The result..

Name Salary
Jith 40000
Muthu Kumar 15000
sangeeth 50000

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by integration services in sql server?

922


How to create a large table with random data for index testing in ms sql server?

981


How to start sql server browser service?

1067


Describe the functionalities that views support.

1053


You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?

147


Why do we use non clustered index?

1010


what purpose does the model database serve? : Sql server database administration

923


What does it mean if @@cursor_row returns a negative number?

943


What is the function of inner join?

1005


tell me the disaster recovery plan

2457


Explain trigger classes i.e. Instead of and after trigger?

826


How can you set the threshold at which sql server will generate keysets asynchronously?

940


explain databases and sql server databases architecture? : Sql server database administration

910


What is scan table/view and seek table/view when its occurs? : sql server database administration

987


What is BCP? When does it used in sql server 2012?

1002