Search This Blog

Sunday, July 23, 2017

Select Second Height Value/ Salary from a Table

SELECT *
  FROM (SELECT e.* ,ROW_NUMBER () OVER (ORDER BY salary DESC) rn
          FROM employees e)
 WHERE rn = 2;

No comments:

Post a Comment

Search String Inside Oracle Database Objects SQL

SELECT owner, name, type, line, text  FROM dba_source WHERE instr(UPPER(text), UPPER('string')) > 0;