Thank you for u r immediate reply.
But i need to select all the fileds in the table.
For that I got the query like
-
CREATE TABLE [dbo].[Employee] (
-
[id] [int] NULL ,
-
[name] [Varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-
[salary] [Numeric](18, 2) NULL
-
) ON [PRIMARY]
-
-
Insert into employee values (1,'Ram', 1000.00)
-
Insert into employee values (1,'Ram', 1000.00)
-
Insert into employee values (2,'Joe', 2000.00)
-
Insert into employee values (2,'Joe', 1000.00)
-
Insert into employee values (3,'Mary', 1000.00)
-
Insert into employee values (4,'Julie', 5000.00)
-
Insert into employee values (2,'Joe', 1000.00)
-
Insert into employee values (1,'Ram', 1000.00)
-
-
--The above is the table and I am trying to find out duplicates
-
-
--My query is
-
SELECT * FROM employee
-
WHERE ID IN (SELECT ID FROM employee
-
WHERE EXIST(SELECT NULL FROM employee AS tmptable
-
WHERE employee.id = tmptable.id
-
group by id
-
HAVING (employee.id > MIN(tmptable.id))))
But it throwing me errors
Sorry for troubling u again
Thanks in advance