【发布时间】:2018-02-06 18:03:36
【问题描述】:
在我的 PostgreSQL 数据库中,我有 users 表,其中包含以下列:
id - integer
email - string
blocked - boolean
现在我想要 sql 查询返回以下结果:
total: blocked: unblocked
total count of users count of blocked users count of users that are not blocked
如何在 PostgreSQL 中做到这一点?
【问题讨论】:
标签: sql postgresql aggregate-functions