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 |
|
duf
Starting Member
39 Posts |
Posted - 2012-03-26 : 09:43:20
|
How to write a query that will join tables and sum up the results of queries?After the join I have a query result:123456 | 10123456 | 02And I would have the result of such:123456 | 12A query looks like this:SELECT WAR, WAL FROM IDCN INNER JOIN IDWARTOSC ON IDCN.CNID=IDWARTOSC.CNID WHERE IDCN.CNID=1; |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-26 : 09:48:55
|
[code]SELECT WAR, SUM(WAL) FROM IDCN INNER JOIN IDWARTOSC ON IDCN.CNID=IDWARTOSC.CNID WHERE IDCN.CNID=1GROUP BY WAR[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
duf
Starting Member
39 Posts |
Posted - 2012-03-27 : 03:58:32
|
| Thanks, but without: "GROUP BY WAR" |
 |
|
|
|
|
|