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

Check Difference Between Two Database Objects

Step-1. Create Two DBLINK to connect with Two Database then Step-2. define logindb= DBLINKONE define remotedb= DBLINKTWO define schema_name=...