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 scheduled job and how to create it?

1037


Can you always create a cache of a report?

178


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

1051


can an order by clause be used in a creation of a view?

1237


What is the difference between char, varchar and nvarchar?

1076


Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

995


How to execute a stored procedure in ms sql server?

1250


what information is maintained within the msdb database? : Sql server administration

1017


How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?

1211


How to loop through returning rows?

1088


How much memory that we are using in Logshipping Concept?

1844


How to connect php with different port numbers?

1147


What is sql server used for?

1099


What is the difference between deallocate cursor and close cursor?

1333


Characterize join and name diverse sorts of joins?

1021