my employee table as
EMP_ID EMP_NAME CONTACTNO SALARY
--------------- --------------- ---------- ----------
Emp01 Mohan Chandra 9560498289 16500
Emp02 Dinesh 9856895689 21000
Emp03 Sachin 7858968956 18000
Emp04 Ajay 9136564555 9500
Emp05 Sneha 7585963212 10625
Emp06 Rahul 9163568958 11300
Emp07 Divya 7539895689 8500
Emp08 Nisha 9758695645 11485
VB.NET
create table temp AS SELECT salary from EMPLOYEE where rownum<3 order by salary desc;Code
select sum(salary) from TEMP;but it is showing result 37500 instead of 39000.
when i written query to see temp table so it shows
Code
SALARY ---------- 21000 16500instead of
Code
SALARY ---------- 21000 18000so what should i do for this.
i want to find sum of two maximum salary from employee table.
my another question is i want to select empname,salary, bonus.and bonus column will be three months of salary per employees.so what should i do?please give me solution.
Code
EMP_NAME Salary Bonus -------------- --------------------

Ehsan SajjadRank #512 · 4.8K reputationPosted Jan 11, 2016, 12:06 AM EST
SELECT * FROM (SELECT salary from EMPLOYEE order by salary desc) E where rownum<3Mohan Chandra92 reputationPosted Jan 11, 2016, 1:46 AM EST
Ehsan SajjadRank #512 · 4.8K reputationPosted Jan 11, 2016, 5:10 AM EST
Mohan Chandra92 reputationPosted Jan 11, 2016, 3:23 PM EST