Article:
  SQL Subqueries
Subject:   i want a previous value of the max value
Date:   2005-01-31 20:33:08
From:   raviambala
i want a prevoius value of the max value
for example we have a table Employee
EmpId EmpName Salary
a001 Ravi 10000
a002 Amit 9500
a003 Chetan 15000
a004 Rahul 6500

the max of salary is 15000
in the above table i want the second max salary means 10000
Main Topics Newest First

Showing messages 1 through 3 of 3.

  • i want a previous value of the max value
    2005-03-29 03:41:22  Ansu [View]

    select * from Table1 A
    where (n-1) =(select count(*) from Table1 b
    where a.[fieldname] < b.[fieldname])
  • i want a previous value of the max value
    2005-10-27 23:35:55  jagadishprem [View]

    SELECT MAX(SAL) FROM EMP WHERE SAL<(SELECT MAX(SAL) FROM EMP)
  • i want a previous value of the max value
    2006-08-30 05:36:13  pavan_bh [View]