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 is filtered index?

1106


What is a performance monitor?

979


What is the security principal at the server level that represents your session?

1021


What is the web service used for reporting services?

126


Explain system rowset functions?

1008


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

128


Explain what is the purpose of sql profiler in sql server?

1086


What is the minimum recommended amount of ram for sql server 2012 enterprise?

941


Can a function call a stored procedure in sql server?

966


You want to implement the one-to-many relationship while designing tables. How would you do it?

965


What is the ‘fillfactor’?

973


What are commonly used mssql functions in php?

1087


What is a constant or literal in ms sql server?

1054


Write the SQL query to drop, truncate and delete table.

980


What is the difference between count and distinct count?

891