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 |
KrisE
Starting Member
1 Post |
Posted - 2014-12-23 : 10:54:46
|
Hi,
I have a query that I need to group by by using the aggregate function using MSSQL
I want to be able to group the following columns into ONE line: AddedDescription, OurRef, MaterialName, StockFamily, DateCreated, WJCStatusID AND THEN have WeightToSend Summed for all lines that are grouped above
any ideas?
|
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2014-12-23 : 11:44:21
|
you can concat fields like so, select field1 + ' ' + field2 + ' ' + field3 'mergeddata' From yourtable
We are the creators of our own reality! |
 |
|
mhorseman
Starting Member
44 Posts |
Posted - 2014-12-24 : 05:47:49
|
Or do you mean something like this:
select AddedDescription, OurRef, MaterialName, StockFamily, DateCreated, WJCStatusID, SUM(WeightToSend) from yourtable group by AddedDescription, OurRef, MaterialName, StockFamily, DateCreated, WJCStatusID
Mark |
 |
|
|
|
|