HQL的子查询什么都不返回

时间:2018-08-06 16:39:58

标签: sql hive return subquery

正在运行以下HQL:

for(var prop in data) {
    var obj = {
        name: prop.name,
        description: prop.description,
        professor: prop.professor
    };
    console.log(obj); // U can use this obj object to applu your further logic
}

但是什么也没回来,有人可以告诉我为什么吗?
我希望输出像这样:

hive>select period,count(*) from
(select case when hour(a.first_time)>=21 and hour(a.first_time)<24 then'21-24'
             when hour(a.first_time)>=12 and hour(a.first_time)<21 then'12-21'
             else '0-12'
             end as period
             from longyuan_web.tv_log as a ) p1
group by period;

非常感谢你!

0 个答案:

没有答案