Mysql
 sql >> Database >  >> RDS >> Mysql

MySql - ordina per nomemese

puoi specificare come

ORDER BY FIELD(MONTH,'January','February','March',...)


SELECT leave_balance.balance, MonthName(leave_balance.date_added) AS month 
FROM leave_balance WHERE leave_balance.staff_id_staff = $iid 
GROUP BY month,  leave_balance.leave_type_id_leave_type 
HAVING leave_balance.leave_type_id_leave_type = $leaveBalTypID 
ORDER BY FIELD(MONTH,'January','February','March',...,'December');