这个:
输出如下:
现在,我想对上面的表应用计数功能,为此我执行了以下查询。
select count(date1) from (
select date1 from tmp where
current_date > date1
);
并得到此错误:Error code 20000, SQL state 42X01: Syntax error: Encountered "" at line 4, column 1.
注意:我正在使用Java DB
最佳答案
子查询通常需要一个别名,尝试
select count(date1) from (
select date1 from tmp where
current_date > date1
) a ;
关于sql - 为什么Count函数在此子查询上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30542346/