Use the group by and COUNT.
SELECT MIN(id) AS id, name, code, COUNT(*) AS count_of_name
FROM table
GROUP BY id, name, code
Richard brought up a good point that I overlooked. You cannot have the ID in your result set if you want the count because you are counting name and code, not id, name, and code.
I updated the sql so that you'll get the lowest ID for each name and code combination.
Update:
Kornfeld also brings up a good point. Even though you put ID in the result set, there's a good chance you don't actually want that in your result set and it's just the numbering of rows in the UI.
Then just remove ID from the sql and you'll have:
SELECT name, code, COUNT(*) AS count_of_name
FROM table
GROUP BY name, code
But for us to know for sure, we need to hear some feedback from you.