Here is the text of my query that has a syntax error.
select cc, sum(a.hours),b.labcost
from labour a,othshop b
where lab_cd='hs' and a.mon=03 and a.yr=2010
group by a.cc
HAVING a.cc=b.occ AND b.mon=03 and b.yr=2010;
All the tables exist. What is wrong with the text of this query?