with my_select as
(select a.eco,b.eco_name,count(b.eco_name) as occurance
from `game`.`chess_game` as a, `game`.`chess_eco_codes` as b where a.eco=b.eco
group by a.eco,b.eco_name)
select * from my_select
where occurance = (select max(occurance) from my_select)
or occurance = (select min(occurance) from my_select)
2条答案
按热度按时间7fyelxc51#
你好尝试一个with子句来存储一个查询并重复使用它,如下所示:
50pmv0ei2#
如果您使用PySpark,您应该学习如何以Python方式编写它,而不仅仅是SQL。