HADOOP HIVE QUERY - SQL



我在hive中写了一个查询。它不工作查询:

hive>> select country ,max(total_count) from (select country, count(airlineid) from airport group by country) t2;

显示表达式group by 'country' is missing

多重问题。如果你格式化它,你应该可以看到它。

select
country, -- you need to add this in group by after t2.
max(total_count) -- you need to create/alias a column called total_count
from
(
select
country,
count(airlineid)
from
airport
group by
country
) t2;
修复SQL -
select
country,  
max(total_count) max_total_count
from
(
select
country,
count(airlineid)total_count
from
airport
group by
country
) t2
group by country
;

相关内容

  • 没有找到相关文章

最新更新