Ok so I've run into an issue that I can't seem to solve. I have this query:
SELECT aae.AutoAttendantEventID,
h.Name,
aae.EventDateTime,
aae.Port,
aas.DTMF,
aas.MenuName
FROM HierarchyNodes h
INNER JOIN AutoAttendantEvents aae
ON (h.HierarchyNodeID = aae.StoreID)
INNER JOIN AutoAttendantStages aas
ON (aae.AutoAttendantStageID = aas.AutoAttendantStageID)
WHERE h.HierarchyNodeID IN (17)
AND aae.EventDateTime >= "2004-06-13"
AND aae.EventDateTime < "2004-06-19"
All is fine with that query, but once that query is finished I have to run this query against every row returned above:
SELECT count(AutoAttendantStageID) as CompletionLevel
FROM AutoAttendantStages
WHERE AutoAttendantEventID = 14811
Numbers given in both querys are examples, they are code generated. So what I want to know, and haven't been able to figure out myself is can I, and if so how can I, combine these queries into one?
Thanks