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 |
|
mukhan85
Starting Member
46 Posts |
Posted - 2008-05-30 : 16:02:57
|
Hi, how are you? I have a table which contains the following columns:SFINet SFICom SFUbit SFUroot------ ------ ------ -------1 ________ 2 ______3 _______4is there any way to group by the first 3 letters:SFI: 3 (sum of two columns: SFINet and SFICom)SFU: 7 (sum of two columnts: SFUbit and SFUroot)Thank you I appreciate your help! |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-05-30 : 16:29:09
|
like this?select SFINet+SFICom, count(*)from yourtablegroup by SFINet+SFICom elsasoft.org |
 |
|
|
mukhan85
Starting Member
46 Posts |
Posted - 2008-05-30 : 18:49:31
|
well, not exactly, the first two columns have SFI in common and the second two columns have SFU in common, so I need to Gropu by SFI and SFU and get the sum for each group. So I need to use somethink like where columnName LIKE "SFI%" ... and colName2 LIKE "SFU%"... something like that.Thank you.quote: Originally posted by jezemine like this?select SFINet+SFICom, count(*)from yourtablegroup by SFINet+SFICom elsasoft.org
|
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-05-30 : 19:32:59
|
i still have no idea what you want.post sample data and expected results based on that sample data. elsasoft.org |
 |
|
|
|
|
|