SELECT * FROM (SELECT * FROM table_name ORDER BY column_name DESC ) WHERE ROWNUM <3;
let table name AJ and column name SALARY then select top to row in descending order, order by salary
Hey, your ans is here, hope it will help, here table name is salary_table and column name is salary , based on that query is look like this...
salary_table
salary
SELECT * FROM (SELECT * FROM salary_table ORDER BY salary DESC) WHERE ROWNUM < 3;
How we can get nth max salary from Employee Table (EMP_ID, Salary)
Emp_id salary 1 1000 3 2000 4 16000 2 10000 7 19000 8 12000
e.g. for 3rd max salary, salary is 12000 so answer will be emp_id : 8
I am a beginner. Can someone explain how to write a SOQL query to get child custom object when parent information is given and vice versa? //student__c - child object, college__c-parent object, Related through Master detail