I am not sure how to ask the question so I am not sure what i am looking for. Here is what I am trying to do.
My table has zipcodes and a counter column
id zipcode count
11 50022 23
12 50023 1
13 50025 8
14 50042 2
15 50076 2
I need to have a select statement that returns the zipcodes X the amount in the counter column (integer value).
So the select return looks like this:
50022
50022
50022
50022
50022
50022 (and on 23 times)
50023 (one record here)
50025 (there were eight of these so eight records).
and so on.
Is there a function or grouping of functions that can achieve this in MySQL?
This is part of a larger query so I can't handle this in server-side code (otherwise I would just create a loop).
Hope all this makes sense and thanks in advance!
UPDATE: I am not trying to get a distinct grouping ...doing the opposite (as one person commented below).