SELECT GROUP_CONCAT(id SEPARATOR ',') FROM `tabella` WHERE `condition` = 31063739 ORDER BY `sorting_field` DESC;