My MySQL table has below records,
ID Name Account
-----------------------------------------
1 ABC PQR
2 DEF PQR
3 ABC PQR
4 XYZ ABC
5 DEF PQR
6 DEF ABC
I am looking for an output like
ID Name Account Duplicate Sr No.
-----------------------------------------
1 ABC PQR 1
2 DEF PQR 1
3 ABC PQR 2
4 XYZ ABC 1
5 DEF PQR 2
6 DEF ABC 1
Here i mean that each duplicate should have a Sr Number or number the duplicates.
Name : ABC and Account : PQR when repeated in the table, there is an increment in the Duplicate Sr No from 1 to 2