There is the table 'treatment' that contains the columns, 'staff_no', 'patient_id', 'start_date', 'reason'. Now, I have to select a query to get the number of distinct patients undergoing each type of treatment (ie reason for treatment) in the database, ordered alphabetically by the reason for the treatment but only have to list the treatments that have at least 2 patients undergoing them. This is what I wrote-
SELECT COUNT (DISTINCT patient_id) CountNumber, reason FROM 'treatment' GROUP
BY reason ORDER BY reason;
but i get the #1064error.