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

Java to Oracle database Connection Using JDBC

Oracle database. // Java Program to Establish Connection  // in JDBC with Oracle Database // Importing database import java.sql.*; // Import...