Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

groupby sort sql hive

SELECT 
    place, 
    cnt, 
    sum_ 
FROM (
    SELECT 
        place, 
        count(*) as cnt, 
        sum(weight) as sum_ 
    FROM a 
    GROUP BY place
) a 
ORDER BY place;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #groupby #sort #sql #hive
ADD COMMENT
Topic
Name
6+8 =