Click here to Skip to main content
14,644,614 members
Rate this:
Please Sign up or sign in to vote.
See more:
i want to get ID of all rows (in a single column) on which aggregate function is applied.

for example

select sum(colData), IDofAllRows from table1
Updated 23-Dec-15 12:19pm
CHill60 23-Dec-15 18:54pm
Some sample data and your expected results would help us to help you. Use the "Improve question" link to add detail
jgakenhe 23-Dec-15 20:12pm
So you want to aggregate results into 1 row. Oracle makes it easy, but SQL Server is not so easy. I am not sure what DBMS you're using, but the examples below should help.


SQL Server: No function I'm aware of, here's some technigues

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100