例子,sql分组查询实例。
复制代码 代码示例:
select family,count(*)as familyNum from bold group by family order by familyNum desc
输出结果:
Emberizidae 739
Anatidae 735
Tyrannidae 635
Parulidae 507
Scolopacidae 399
Muscicapidae 349
Fringillidae 346
Turdidae 317
Picidae 299
Sylviidae 289
Corvidae 248
Furnariidae 227
Paridae 203
Accipitridae 196
Strigidae 194
Icteridae 190
Columbidae 178
Sturnidae 164
Spheniscidae 162
...