i have a mysql result set like bellow
id name
---------------------
1 abc
1 abc
2 xyz
2 xyz
3 pqr
now i need to modify the result set so that it would be like as follows:
id name
---------------------
1 abc-1
1 abc-2
2 xyz-1
2 xyz-2
3 pqr
the summarization is i need to numbering the name column from result set and the numbering will only apply on the rows which have more than one value in the result set.
so what will be the MySQL SELECT Query?
this might work but there’s probably a better way that i can’t think of right now
EDIT: as stated in comments above, better to do this at the app level vs. db