sql - Raw data before each group by -


which queries should execute in order show raw data before every group row? there way that?

user   receiptno   price -----  ----------  ------      876         100      877          50                    **150** b      960          60 b      961          40                    **100** 

most database support standard group modifiers such rollup or grouping sets. if so, can do:

select user, receiptno, sum(price) price t group grouping sets ((user, receiptno), (user)); 

Comments

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -