select next highest salary or last login date ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    select next highest salary or last login date ...

    good spam subject ;).

    anyway, i'm alittle stumped. i'm in need of putting together a query
    that gets the next highest salary ( select max ( sal ) - 1?, from an
    emp_sal type table. another example is if i have a login_history table,
    and i'm logged in, but i want to display the date of my previous login.
    if the login_history table has user_id and login_date which makes up
    the primary key, how can i get the most recent login (minus the most
    recent one?).

    the max function comes to mind and use of the rowid/rownum colums, but
    is there an easier, more obvious way to do this perhaps?

Working...