have totals with my results.
But out of shear meanness they won't let me use them unless I use a
Group By clause in my select. I have a proc with 25 fields, and have
no desire to Group By anything- when a certain field changes, I just
want a row with the total of that field.
Is this possible?
Thanks,
BurtNot totally sure what you are asking, but maybe COMPUTE will do what you need.
SELECT col1, col2
from t1
COMPUTE SUM(col1)
Non-standard SQL I believe but occasionally useful.
Mike John
"Burt" <burt_5920@.yahoo.com> wrote in message news:19e5f39f.0309190842.50760c96@.posting.google.c om...
> MS has been nice enough to add the Cube and Rollup operators so I can
> have totals with my results.
>
> But out of shear meanness they won't let me use them unless I use a
> Group By clause in my select. I have a proc with 25 fields, and have
> no desire to Group By anything- when a certain field changes, I just
> want a row with the total of that field.
>
> Is this possible?
>
> Thanks,
>
> Burt|||You might find it necessary to put all the columns in the "select" clause
also into the "group by" clause, where you can then add a "rollup" or "cube"
clause. You might also find it useful to add a suitable "order by" clause.
Goetz Graefe
Microsoft SQL Server development -- Comments given as personal opinions and
suggestions only.
"Burt" <burt_5920@.yahoo.com> wrote in message
news:19e5f39f.0309190842.50760c96@.posting.google.c om...
> MS has been nice enough to add the Cube and Rollup operators so I can
> have totals with my results.
> But out of shear meanness they won't let me use them unless I use a
> Group By clause in my select. I have a proc with 25 fields, and have
> no desire to Group By anything- when a certain field changes, I just
> want a row with the total of that field.
> Is this possible?
> Thanks,
> Burt
No comments:
Post a Comment