Hello,
I have a table with a field AFM (integer), I want to display all fields of the AFM column that have the same value eg.
1 row has 1111
2 row has 4567
3 row has 1111
4 row has 5678
5 row has 3456
6 row has 3456

I want to display the 1 and 3 row and the 5 and 6 row,
I tried this but it gave me the whole column values:

select AFM from kyrf1 WHERE AFM = AFM

Can I find double or triple values in the same column of the same table with sql?

Thank you

Hi, I would try using the GROUP BY & HAVING clause...

SELECT
AFM,
count(AFM) 'Count'
FROM
kyrf1
GROUP BY AFM
HAVING COUNT(AFM) > 1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.