select (
SELECT SUM(countNumber) from(
SELECT FROM_UNIXTIME(unix_timestamp(AddTime),'yyyy-MM-dd') AS dateTime,
COUNT(productID) AS countNumber
FROM product
GROUP BY FROM_UNIXTIME(unix_timestamp(AddTime),'yyyy-MM-dd')
) as bb
where aa.dateTime >= bb.dateTime
) as totalCount,
aa.countNumber,
aa.dateTimefrom (
SELECT FROM_UNIXTIME(unix_timestamp(AddTime),'yyyy-MM-dd')AS dateTime,
COUNT(productID) AS countNumber
FROM product
GROUP BY FROM_UNIXTIME(unix_timestamp(AddTime),'yyyy-MM-dd')
) aa order by dateTime desc limit 10000;
Я не хочу запрашивать ежедневное суммарное количество. Почему этот HQL не работает? Подсказка движка Hive:
FAILED: ParseException line 2:8 cannot recognize input near 'SELECT' 'SUM' '(' in expression specification