how to find the particular row in table?(means suppose one
table contain 10 rows , in these 10 rows how to find the
particular row(example in 10 rows i want 5 row how)?
Answers were Sorted based on User's Feedback
Answer / senthilkumar
SELECT TOP 1 Empid
FROM (SELECT DISTINCT TOP 6 Empid FROM Employees ORDER
BY Empid desc) a ORDER BY Empid asc
| Is This Answer Correct ? | 4 Yes | 6 No |
Answer / vamsi krishna
select * from <table name> order by <column name> limit 0,5;
or
select * from <table name> limit 0,5;
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / owen
-- I believe the questionner wants the 5th row
-- (only) from the data.
-- I also assume we don't have a useful ID to work with.
-- This is one way of doing it without cursors:
select top 1 <fieldname>
from <TableName>
where <fieldname> not in
(select top 5 <fieldname>
from <TableName>)
-- NB Changing the "5" in the subquery above sets which
-- row number is returned
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / ritu saini
SELECT TOP 5 column FROM table
ORDER BY NEWID()
| Is This Answer Correct ? | 14 Yes | 25 No |
Answer / sruthi
select top5 * from table
minus
select top4 from table
| Is This Answer Correct ? | 5 Yes | 19 No |
What is the difference between varchar and varchar types?
How is table type constraint applied to a table?
What is the basic functions for master, msdb, tempdb databases?
What r sql reporting services and analysis services? how can we use it.
Is it possible to update the views? If yes, how, if not, why?
List out the differences between the clustered index and non-clustered index in sql server?
How many types of stored procedures are there in sql server?
Equi join and non equi join is possible with sql server?
How to find out name of all employees who has salary less than 200 Rs.?
is there a column to which a default can't be bound? : Sql server database administration
what is the information that can be stored inside a bit column? : Sql server database administration
Explain acid?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)