Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想计算 Firebird 数据库中有多少条记录的时间戳字段为空或不为空。怎么做?
像这样的东西:
select RECORD_TYPE, count(*), (MY_TIMESTAMP IS NULL) from MY_TABLE group by RECORD_TYPE, (MY_TIMESTAMP IS NULL)
我正在使用火鸟 2.5
您可以输出具有两列的单个记录,
SELECT COUNT(MY_TIMESTAMP) AS TOTAL_NOTNULL, COUNT(CASE WHEN MY_TIMESTAMP IS NULL THEN 1 END) TOTAL_NULL FROM MY_TABLE