La proposizione ORDER BY (id) è in conflitto con DISTINCT.