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]
|