I have a simple table with two columns. The first field represents an id, the second one a name (string value). No field is unique. So, e.g., there are many records like:

What I need is a simple SQL statement which shows me the whole table in the following format and inserts the content into a new table.

Any help?
Just use
COUNTfunction to countfrom_id. And if you want to count in group, useGROUP BYclause for that. Like this one.This will return your desired result.
Now you want to insert it into new table then you can do like this: