|
Me again.... 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?
(comments are locked)
|
|
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.
(comments are locked)
|
|
does this give you what you need: What I would need is the count to be broken down by empnid or group by empnid. So the COUNT(b.empnid) counts the rows in the b alias subquery based on a per employee basis. I would need the query you had added to do say a COUNT(cusnid) based on the employee also. So for example I need a return set to show: EMPLOYEE IN OUT ORDERS NON Andy 08:52AM 05:02PM 21 5 Angelo 06:12AM 08:17PM 19 6 Bob 08:39AM 05:30PM 24 10 The count for non I cannot pass through. Thanks for looking at this. I REALLY APPRECIATE IT!
Mar 09 '11 at 02:09 PM
Noonies
Ahh I had no idea that empnid had a relationship to that table
Mar 10 '11 at 03:28 AM
Kev Riley ♦♦
(comments are locked)
|

