Tuesday, 20 August 2013

SQL Query logic to count re-assigned records

SQL Query logic to count re-assigned records

I have the following table in which mechanics are assigned to Vehicles. I
am trying to figure out how to sum all of the assignments and subtract all
re-assignments for each mechanic.
The results should be the mechanic N0055345 should have 2 assignments and
mechanic N0057581 should have 0 (due to re-assignement).
Auto ID EntryDate Mechanic ID Vehicle Type
1022011 8/19/2013 N0055345 CAR
1022011 8/18/2013 N0057581 CAR
1022014 8/15/2013 N0055345 CAR
Thanks, Brad

No comments:

Post a Comment