Changes between Version 27 and Version 28 of AdvancedReports
- Timestamp:
- 04/09/24 14:47:54 (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v27 v28 27 27 == Прикажување на вработен (доктор) кој што има напишено најмногу извештаи за едно исто милениче. 28 28 {{{ 29 WITH Doctor ReportsCount AS (29 WITH DoctorPetReportsCount AS ( 30 30 SELECT 31 31 u.id AS doctor_id, … … 39 39 GROUP BY 40 40 u.id, u.name, r.petsID 41 ORDER BY 42 reports_count DESC 43 LIMIT 1 41 ), 42 43 MaxReportsPerPet AS ( 44 SELECT 45 pet_id, 46 MAX(reports_count) AS max_reports_count 47 FROM 48 DoctorPetReportsCount 49 GROUP BY 50 pet_id 44 51 ) 45 52 46 53 SELECT 47 drc.doctor_id, 48 drc.doctor_name, 49 drc.pet_id, 50 drc.reports_count 51 FROM 52 DoctorReportsCount drc; 54 dprc.doctor_id, 55 dprc.doctor_name, 56 dprc.pet_id, 57 dprc.reports_count 58 FROM 59 DoctorPetReportsCount dprc 60 JOIN 61 MaxReportsPerPet mrpp ON dprc.pet_id = mrpp.pet_id AND dprc.reports_count = mrpp.max_reports_count 62 JOIN 63 project.users u ON dprc.doctor_id = u.id 64 WHERE 65 dprc.pet_id = (SELECT pet_id FROM MaxReportsPerPet ORDER BY max_reports_count DESC LIMIT 1); 53 66 }}} 54 67 == За секое прашање кое е поставено во Blog Post For Consultations колку одговори има, од кои корисници се дадени одговорите и каква е улогата на корисниците кои одговориле(admin, manager, employee, standard).