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 |
|
phaze
Starting Member
42 Posts |
Posted - 2007-02-01 : 16:36:09
|
| Hello,I am trying to take my result set and dividing up the results into 4 equal groups I have included my code and a partial result set. All of your input and help is appreciated as I am new at thisselect accounts.id, sum(trans.amount) as 'income'from jom.dbo.accountsjoin jom.dbo.transon trans.accounts_id = accounts.idwhere trans.amount > 0group by accounts.idid income47109 8.0047110 8.0047111 12.0047112 16.0047125 16.0047126 10.0047127 8.0047128 16.0047129 42.9947142 139.0047143 8.0047144 52.0047145 5.0047159 625.9447160 75.0047161 8.0047162 8.0047176 25.0047177 20.0047178 16.0047179 28.0047192 74.9447193 248.0047194 176.0047195 39.9947196 16.0047209 16.0047210 46.0047211 177.0047212 8.0047226 44.0047227 178.9947228 24.9747229 27.0047242 16.0047243 24.0047244 8.0047245 49.0047246 70.0047259 19.9547260 10.0047261 22.0047262 40.0047276 8.0047277 68.0047278 8.0047279 8.0047293 16.0047294 56.0047295 10.0047296 63.0047309 34.0047311 26.0047312 18.0047326 24.0047327 16.0047328 215.0047329 8.0047343 19.9547344 19.9547345 19.9547346 42.0047359 62.0047360 16.0047361 75.0047362 40.0047363 8.0047376 19.9547377 19.9547378 24.0047379 13.0047393 8.0047394 98.9547395 63.9547396 25.9547410 21.0047411 47.0047412 229.0047413 8.0047426 18.0047427 8.0047428 60.0047429 44.9547443 93.0047444 20.0047445 10.0047446 18.0047460 28.0047461 16.0047462 32.0047463 48.0047476 22.0047477 110.0047478 16.0047479 36.0047480 8.0047493 98.9547494 60.0047495 24.0047496 98.00 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-01 : 17:16:55
|
| What is "4 equal groups"?Peter LarssonHelsingborg, Sweden |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-01 : 19:56:09
|
what happen when the results is not divisible by 4 ? KH |
 |
|
|
|
|
|