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 |
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-12-02 : 09:22:58
|
| Why am I getting an Invalid column name 'vol' when I run the below query?select c.symbol, sum(bi.volume) as volfrom invoices biinner join company c on bi.company_id = c.company_idgroup by c.symbol, vol |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-02 : 09:28:02
|
| You just need thisselect c.symbol, sum(bi.volume) as volfrom invoices biinner join company c on bi.company_id = c.company_idgroup by c.symbolMadhivananFailing to plan is Planning to fail |
 |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2009-12-02 : 09:31:11
|
| To elaborate a bit you can not group by the column you are aggregating. I've noticed if you don't answer something within the first 5 seconds of posting Madhiv will beat you to it ;-) |
 |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-12-02 : 09:33:35
|
| Madhivanan is the man! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-02 : 09:35:31
|
<<I've noticed if you don't answer something within the first 5 seconds of posting Madhiv will beat you to it ;-)>> MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|