sql server - sql sub and grand total -


is there nice consise way grand totals here-- query shows sub totals each day, how can grand total of each sub total without sub query or query

also there better use compute sum?

select loguser,logdate,logaction,logtime log loguser in ('scott')   , logdate   between '2011-06-01' , '2011-06-15'    order logdate desc     compute sum(logtime) logdate 

sql server 2008 r2

i'm not familiar compute you've used it, (or variation on it) should work in sql dialects...

select loguser,logdate,logaction,sum(logtime) log loguser in ('scott')   , logdate   between '2011-06-01' , '2011-06-15' group loguser,logdate,logaction rollup order logdate desc     

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -