You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS rubroName, socios_aux_rubros.id FROM socios_aux_rubros Order by socios_aux_ru' at line 1