• google for Cube and Rollup in sql, might be that's your answer:w00t: