Distinct count in MS SQL

The below code will retrieve distinct count from a table in SQL
select ename, count(ename) from emp
Group by ename having (count(ename)>1)

Comments

Popular posts from this blog

How to get Computer Name using VB6 Code

Make database read/write in MS SQL Server

Copying rows from one Access database to Another using Query