Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
usafelix
Posting Yak Master
165 Posts |
Posted - 2014-08-23 : 07:41:25
|
date shop sku staff qty amt 0813 13:20 hk book david 2 500813 18:20 usa toy mary 1 150813 09:15 hk cake ken 3 3500813 13:40 can toy mak 7 10i want... shop sku staff qty amt0813 0915 hk cake ken 3 3500813 13:20 hk book david 2 50total : 5 qty $4000813 13:40 can toy mak. 7 $ 10total : 7qty $100813 18:20 usa toy mary 1 $10total : 13 qtygrand total : 420it is any easy way to write a simple query ? |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2014-08-23 : 07:46:17
|
Have a look at Books Online (the SQL Server help file) for GROUP BY and specifically GROUP BY GROUPING SETS ((Shop, SKU), ()) Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
|
|
|