Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 382 Bytes

count-records-by-type.md

File metadata and controls

17 lines (14 loc) · 382 Bytes

Count Records By Type

If you have a table with some sort of type column on it, you can come up with a count of the records in that table by type. You just need to take advantage of group by:

> select type, count(*) from pokemon group by type;

  type   | count 
-----------------
 fire    |    10
 water   |     4
 plant   |     7
 psychic |     3
 rock    |    12