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;
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
Post a Comment