I'm writing a query which will total the COUNT returned in the subquery alias b. But I need to add another subquery which will COUNT based on lets say an alias c.
Here is what I have:
I would like to add as a subquery alias C
And have a COUNT(c.cusnid) or something like that to give me an additional column count on the main select. I was trying to join alias C on employeeid but this was not working. the ORDERS count would increase and become incorrect.Any suggestions how I can add an additional count to a subquery or how I should go about writing this?
asked Mar 09 '11 at 01:29 PM in Default
I stepped away from this and came back with a cleared head. I was able to add the alias C and join on empnid and visitedbynid and pull count through the alias subquery for c. This is taken care of. Thanks again.
GROUP BY b.Employee, b.[Time In], b.[Time Out], c.NONSERVICE
answered Mar 09 '11 at 03:08 PM
does this give you what you need:
answered Mar 09 '11 at 01:55 PM
Kev Riley ♦♦