All pastes #662022 Raw Edit

Untitled

public text v1 · immutable
#662022 ·published 2007-08-18 07:34 UTC
rendered paste body
i have a table with two columns " id","sales"

id  sales
1   10
1   10 
1   10
2   20
2   20
2   20
3   30
3   30
3   30

now i need a query like the following

id  total_avg avg_for_id
1    20        10
2    20        10
3    20        10

how can i do this