2012-11-27 82 views

回答

1

你可以做这样的事情。我已经假设你的表名为'动物',而你所指的动物类型字段被命名为'AnimalType'。

SELECT AnimalType, COUNT(AnimalType) 
FROM Animals 
WHERE AnimalType IN ('Cats','Dogs') 
GROUP BY AnimalType 
+0

感谢它的工作...... –

0
select type, count(*) from the_table group by type; 

,或者如果你只是想猫狗(但没有鸟):

select type, count(*) from the_table 
where type in ('cat', 'dog') 
group by type; 
+0

感谢它的工作.. –

相关问题