如何将 WHERE 函数添加到我的查询中?
SELECT count(*), date_trunc('year', "createdAt") AS txn_year
FROM tables
WHERE active = 1 // not working I don't know why
GROUP BY txn_year;
谢谢你的意见
最佳答案
SELECT count(*), date_trunc('year', "createdAt") AS txn_year
FROM tables
WHERE column_active = 1
GROUP BY txn_year;
关于sql - PostgreSQL 如何添加 WHERE where is count() 和 GROUP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30899795/