sql分组统计查询 count带条件
sql分组统计查询 count带条件
// count括号里带统计条件 SELECT user_id,count(type=1 or null) donate_num,count(type=2 or null) rent_num FROM ot_dynamic GROUP BY user_id
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
sql分组统计查询 count带条件
// count括号里带统计条件 SELECT user_id,count(type=1 or null) donate_num,count(type=2 or null) rent_num FROM ot_dynamic GROUP BY user_id