MySQL query giving erroneous results because of the mode of only full group by [duplicate]
问题 This question already has answers here : MySQL Select only one row from each patient diagnosed according the the first date (3 answers) Closed 2 years ago . I have this unanswered question where I had this erroneous result query: SELECT t1.patient_id, CONVERT(aes_decrypt(t4.patient_name_en, :encKey) USING utf8mb4) as patient_name_en, min(t3.date_of_visit) as date_of_visit, t2.diagnosis_name, max(ifnull(t5.date_of_assessment, 'N/A')) as date_of_assessment, ifnull(t5.assessment_result, 0) as