View Single Post

  #5 (permalink)  
Old 01-09-2008, 03:42 PM
tprabhuit's Avatar
tprabhuit tprabhuit is offline
Junior Member
 
Join Date: Dec 2007
Location: Coimbatore
Posts: 16
tprabhuit is on a distinguished road
Send a message via Yahoo to tprabhuit
Hi,

Below is a simple query to find the Nth Maximum / Minimum value of particular column.

Nth Minimum
SELECT * FROM <Table_Name> A
WHERE N = (SELECT COUNT(DISTINCT B.Column_Name ) FROM <Table_Name> B WHERE A.Column_Name >= B.Column_Name)


Where,
N is integer
A & B are alias for the Table

Regards,
Prabhu.T
Reply With Quote