| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
SELECT b.field1by changing the value (3) in last line you will get nth max value |
|
|||
|
Quote:
Ans : query is like this : SELECT TOP 1 Salary FROM (SELECT TOP 2 Salary FROM Employee ORDER BY Salary DESC) AS E ORDER BY Salary ASC |
|
|||
SELECT * FROM product_master AS e1 where N is number you want for example if you want 3rd highest than SELECT * FROM product_master AS e1 |
|
|||
|
Quote:
yes this will work ^_^ our sir gave us a hard way to find the 2nd highest value. thax |
|
|||
|
to find the third highest row in a table (employee_test for e.g.)
SELECT min(Emp_Sal) FROM Employee_Test WHERE Emp_Sal INVishal |
|
|||
|
Quote:
even I checked this out but could not understand what is happening. Can someone please explain to me what is happening here? how the value '1' is used to get the second highest value??? |
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find out the 4th highest value from the column? | Anoj biradar | SQL - Questions and Answers | 3 | 12-05-2007 03:54 AM |
| How to find second highest value of a column in a table? | SQL? | jaheer | SQL - Questions and Answers | 9 | 07-24-2007 11:07 AM |
| how to find third highest record from table? | davinder singh | SQL - Questions and Answers | 3 | 12-19-2006 11:57 AM |