sql - Count distinct same names -


i have table have on 100k information.

id        firstname 1           bob 2           bob 3           tom 4           john            5           john 6           john ..          .... 

want procedure count how names same, example must :

firstname      count bob              2 tom              1 john             3 

please me write it

it's basic sql example, group column + aggregating results

select     firstname, count(*) table1 group firstname 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -