HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY
IN EMP TABLE

Answer Posted / asit

Can someone answer to this. on below query where i want to find same salary in employee table,

SELECT * FROM EMPLOYEE WHERE (SAL IN (SELECT sal FROM empLOYEE GROUP BY sal HAVING COUNT(sal) > 1))

i am getting correct output.

but if i change it to 'COUNT(SAL)>=1' then it prints all the lines from the table.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is natural join and equi join same?

521


What is set nocount on and what is set nocount off?

512


What are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture

559


What is mean by dml?

535


What are the pre-defined functions in the sql server?

518






What is difference between unique and primary key?

477


If the job running very slow what is the action you do

1425


What are the types of stored procedures in an sql server?

472


What is statement level trigger?

537


Does a full backup include transaction log?

479


Tell about MOM Tool(Microsoft Operator Manager)?

1411


What are joins in sql and what are the different types of joins?

549


what is hash nonclustered index

535


What does the update command do?

611


Explain the difference between functions and stored procedures in sql server?

476