MySQL---统计表a中数据的总条数、统计表a中“状态”字段为“1”的条数

来源:互联网 发布:淘宝网上卖什么东西销量好 编辑:程序博客网 时间:2024/05/16 07:09

1、统计表a中数据的总条数:

select count(id) from a



2、统计表a中“状态”字段为“1”的条数:

select count(id)from awhere fk_statusid=1