Skip to content

Instantly share code, notes, and snippets.

@Ademking
Last active October 13, 2021 07:52
Show Gist options
  • Save Ademking/4185dc208796e56d4a42dbcbed1e06e8 to your computer and use it in GitHub Desktop.
Save Ademking/4185dc208796e56d4a42dbcbed1e06e8 to your computer and use it in GitHub Desktop.
SQL
internal
(66, 68, 69, 70, 71, 72, 73, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 102, 1099, 1101, 1106, 1111, 1112, 1114, 1115, 1119, 1121, 1122, 1123, 1124, 1125)

internal_ext_control
(1109, 1127, 1128, 1129, 1135, 1136, 1137)

inopinee
(77, 91, 92, 94, 95, 96, 1100, 1102, 1103, 1104, 1105, 1107, 1110, 1113, 1116, 1117, 1118, 1120, 1126)

Nb de plan d'action:

SELECT COUNT(id), org FROM actionplans GROUP BY org;

Nb de tests de followup 'resolved' tous les types

SELECT COUNT(id) AS total_resolved, org FROM followuptests WHERE followup_status = 'resolved' GROUP BY org;

Nb de tests de followup 'being_resolved' tous les types

SELECT COUNT(id) AS total_being_resolved, org FROM followuptests WHERE followup_status = 'being_resolved' GROUP BY org;

Nb de tests de followup 'persists' tous les types

SELECT COUNT(id) AS total_persists, org FROM followuptests WHERE followup_status = 'persists' GROUP BY org; 

nb de tests de followup 'resolved' type de mission "interne"

SELECT COUNT(id) AS total_resolved, org FROM followuptests WHERE followup_status = 'resolved' and old_mission_id in (66, 68, 69, 70, 71, 72, 73, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 102, 1099, 1101, 1106, 1111, 1112, 1114, 1115, 1119, 1121, 1122, 1123, 1124, 1125) GROUP BY org;

Nb de tests de followup 'being_resolved' type de mission "interne"

SELECT COUNT(id) AS total_being_resolved, org FROM followuptests WHERE followup_status = 'being_resolved' and old_mission_id in (66, 68, 69, 70, 71, 72, 73, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 102, 1099, 1101, 1106, 1111, 1112, 1114, 1115, 1119, 1121, 1122, 1123, 1124, 1125) GROUP BY org;

Nb de tests de followup 'persists' type de mission "interne"

SELECT COUNT(id) AS total_persists, org FROM followuptests WHERE followup_status = 'persists' and old_mission_id in (66, 68, 69, 70, 71, 72, 73, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 102, 1099, 1101, 1106, 1111, 1112, 1114, 1115, 1119, 1121, 1122, 1123, 1124, 1125) GROUP BY org;

nb de tests de followup 'resolved' type de mission "inopinee"

SELECT COUNT(id) AS total_resolved, org FROM followuptests WHERE followup_status = 'resolved' and old_mission_id in(77, 91, 92, 94, 95, 96, 1100, 1102, 1103, 1104, 1105, 1107, 1110, 1113, 1116, 1117, 1118, 1120, 1126) GROUP BY org;

Nb de tests de followup 'being_resolved' type de mission "inopinee"

SELECT COUNT(id) AS total_being_resolved, org FROM followuptests WHERE followup_status = 'being_resolved' and old_mission_id in (77, 91, 92, 94, 95, 96, 1100, 1102, 1103, 1104, 1105, 1107, 1110, 1113, 1116, 1117, 1118, 1120, 1126) GROUP BY org;

Nb de tests de followup 'persists' type de mission "inopinee"

SELECT COUNT(id) AS total_persists, org FROM followuptests WHERE followup_status = 'persists' and old_mission_id in (77, 91, 92, 94, 95, 96, 1100, 1102, 1103, 1104, 1105, 1107, 1110, 1113, 1116, 1117, 1118, 1120, 1126) GROUP BY org;

nb de tests de followup 'resolved' type de mission "internal_ext_control"

SELECT COUNT(id) AS total_resolved, org FROM followuptests WHERE followup_status = 'resolved' and old_mission_id IN (1109, 1127, 1128, 1129, 1135, 1136, 1137) GROUP BY org;

Nb de tests de followup 'being_resolved' type de mission "internal_ext_control"

SELECT COUNT(id) AS total_being_resolved, org FROM followuptests WHERE followup_status = 'being_resolved' and old_mission_id in (1109, 1127, 1128, 1129, 1135, 1136, 1137) GROUP BY org;

Nb de tests de followup 'persists' type de mission "internal_ext_control"

SELECT COUNT(id) AS total_persists, org FROM followuptests WHERE followup_status = 'persists' and old_mission_id in (1109, 1127, 1128, 1129, 1135, 1136, 1137) GROUP BY org;
@houcem-h
Copy link

nb de tests de followup 'resolved' type de mission "internal_ext_control"

SELECT COUNT(id) AS total_resolved, org FROM followuptests WHERE followup_status = 'resolved' and old_mission_id IN (1109, 1127, 1128, 1129, 1135, 1136, 1137) GROUP BY org;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment