sql - Hive Script, DISTINCT with SUM -


i trying distinct , find count of teams player played in single season , number of teams played for. tripping me , ofcourse have sample down below(2nd) one. first ones failed attempt

select o.id,o.year,count(distinct(o.team)) b join (select id, year, team batting group id,year,team order id desc limit 25) o  0.id =b.id;    select id, year, team batting group id,year,team order id desc limit 25; 

produces enter image description here

ignore ^a, think represent either space or comma, column seperatpr

get count of teams each player each year , order count desc,get 1 row

select id, year, count(distinct(team)) batting group id,year order count(distinct(team)) desc limit 1; 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -