PureData1
PureData1

Reputation: 71

Distinct value appearing more than once

I am trying to show the unique value from Table B where it occurs on more than one occasion enter image description here

Could someone help with this? Here is my code but it is erroneous. SELECT DISTINCT * FROM B WHERE DISTINCT(Field1)>1

Upvotes: 0

Views: 490

Answers (1)

Dan Bracuk
Dan Bracuk

Reputation: 20804

Try something like

select field1, count(*) records
from b
group by field1
having count(*) > 1

Some details depend on your database engine which you did not specify.

Upvotes: 2

Related Questions