View Single Post
  #5 (permalink)  
Old 12-17-2006, 11:12 PM
Hank Swart
 
Posts: n/a
Default MS SQL answer. Re: i want to get the third highest salary from a table?

[sql]
DECLARE @tblTempStorage TABLE (
[ID] INT IDENTITY(1, 1),
Result FLOAT)

INSERT INTO @tblTempStorage (Result)
SELECT DISTINCT
DEPTH_TO
FROM
GB_SAMPLE
ORDER BY
DEPTH_TO

SELECT
*
FROM
GB_SAMPLE
WHERE
DEPTH_TO = (
SELECT
Result
FROM
@tblTempStorage
WHERE
([ID] = 3))
[/sql]
Edit/Delete Message Reply With Quote