i want only duplicates rows from coloumn
ex. emp_id(colomn name)1,1,2,3,3,4,5,5.
so i want only duplicates no.
Answers were Sorted based on User's Feedback
Answer / kumar.t
Select Emp_Id, Count(Emp_Id) From Employee As Emp
Group By Emp_Id
Having Count(Emp_Id)>1
By
Kumar
Is This Answer Correct ? | 17 Yes | 2 No |
Answer / chinna_g
You have 'emp' table with empid,empname,empsal.
With values:
1 row:1,'hhh',10000
2 row:2,'nnn',10000
3 row:3,'vvv',15000
4 row:4,'jjj',10000
A)
In this table you have sal column 10000 repeating 3 times
in the table, if you want to retrieve the repeated values
i.e. the salary column with 3 times to be displayed in the
following query:
"select empsal from emp where empsal in(select empsal from
emp group by empsal having count(empsal)>1);"
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / v rajkumar
select Emp_Id from Employee group by Emp_Id having count(*)
>1
Is This Answer Correct ? | 1 Yes | 0 No |
How to retrieve duplicate rows in a table? How to delete the duplicate entries in a table?
15 Answers Leo Technologies, Mannar Company, Synechron,
How do I find the query plan in sql server?
What are different replication agents and what's their purpose? : sql server replication
How to update multiple rows with one update statement in ms sql server?
How many types of the database links?
How to Rebuild Master database in sql server 2005.
please can anyone answer this query Table 1 has 2 columns: EmployeeId,Age Table 2 has 2 columns: EmployeeId, Region Write SQL to Find the region who has the oldest person
What is the use of tempdb? What values does it hold?
hi, may i know what is the command to get abstract the current month, current year and current day from a given date.i want these three in a isolated way..seperatedly is that any way in sql server 2000
can you anybody tell me the how can you restore the master database. while migraion(one server to onther server)?
Explain the new features of SQL server 2000?
What are the advantages of using views. Why do we need views when we have SPs?