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

OLEDB Database connection string in C#.Net

How to get Computer Name using VB6 Code

SqlAlchemy[SQLite] database connection in Python-Flask