Advertisement
DimitarVasilev

Untitled

Jul 13th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.94 KB | None | 0 0
  1. --3.2 Each technician is linked to the “Traxxeo install” event. It is possible that there is no bug and
  2. --some of our technicians are using the application wrong hence they are generating more
  3. --than one installation event for a vehicle. Can you check if this is the case?
  4.  
  5. SELECT vehicle_id, CASE WHEN nn> 1 THEN 'Same technicians'
  6. ELSE 'Not the same  technicians'
  7. END , person_id
  8. FROM(
  9. SELECT vehicle_id, person_id, COUNT(1) nn
  10. FROM generic_event g
  11. WHERE name LIKE 'Traxxeo install'
  12. AND vehicle_id IN (118735,118287,118045,118452,107668,117582,118456,117804,117926,117808,116703,
  13. 117494,118920,116524,117841,118535,117802,118375,116914,117305,117992,118192,118267,117418,117637,
  14. 117599,117487,118230,117943,118237,117560,117450,117638,116651,117149,116912,119337,119112,116673,
  15. 117352,117461,119208,118438,118065,117891,118330,118236,118205,117163,117208,116426,117316,116652,116043,117481,119108)
  16. GROUP BY vehicle_id, person_id
  17. ORDER BY 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement