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 |
|
jtrapat1
Starting Member
43 Posts |
Posted - 2002-10-14 : 13:17:08
|
| Could someone please explain the aggregate query below:I have to convert this so that DB2 will understand it.But,I want to understand it first under MS Sql Server.--------------------------------------------------------Insert into appropsdistinct select distinct acode, right(pcode,3),catcode, fundcode, left(objectcode,1), sum(summaryvalue),0,0,0from dob_bps group by (acode + right(pcode,3) + catcode + fundcode + left(objectcode,1)), acode, right(pcode,3),catcode, fundcode, left(objectcode,1)---------------------------------------I don't understand the group by concatenation.Thanks in advanceJohn |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-10-14 : 16:24:04
|
| The concatenation in the group by shouldn't affect how you conceptualize the grouping - a collection by the engine of like values. The "value" may simply be a column value or it might be an expression involving one or more column values.example:a b--- ---0 20 31 32 5select b-a, count(*)from {rowset}group by b-ayields:b-a count(*) (well, {no column name})--- ---2 23 2Jonathan{0} |
 |
|
|
|
|
|
|
|