Feb
12

SQL Window Functions in Hive

Posted on February 12, 2010 by Ron Bodkin

One of the powerful capabilities of SQL 2003 is the ability to use window functions, e.g., this query computes the ratio of a score to the average score of lower scores, for each product

select score/(sum(score)/row_number()), product over (partition by product order by score) from product_scores
Share Button



0 Comments

Leave a Reply