The sum aggregate function is not working. Can someone explain why I get the error below:
[SQL]: select ev.loc_n "Location", route, sum(ev.ttp9) "ttp9"
[Error]: SQLSTATE = 42S22
Microsoft SQL Server Native Client 10.0
The multi-part identifier "ev.loc_n" could not be bound.
select ev.loc_n "Location", route, sum(ev.ttp9) "ttp9"
[SQL]: from ev, ml
where ml.loc_n=ev.loc_n and ml.id=ev.id
and ev.ts >= '2014-01-01 04:00:00.000' and ev.ts <= '2014-02-01 03:59:00.000'
and run>100 and route<799 and ev.fs in (1,2,3,4,5,6,7,8,9)
group by ev.loc_n, route
order by ev.loc_n, route
[SQL]: select ev.loc_n "Location", route, sum(ev.ttp9) "ttp9"
[Error]: SQLSTATE = 42S22
Microsoft SQL Server Native Client 10.0
The multi-part identifier "ev.loc_n" could not be bound.
select ev.loc_n "Location", route, sum(ev.ttp9) "ttp9"
[SQL]: from ev, ml
where ml.loc_n=ev.loc_n and ml.id=ev.id
and ev.ts >= '2014-01-01 04:00:00.000' and ev.ts <= '2014-02-01 03:59:00.000'
and run>100 and route<799 and ev.fs in (1,2,3,4,5,6,7,8,9)
group by ev.loc_n, route
order by ev.loc_n, route