Ver originalSELECT * FROM (SELECT a.nombre, m.marca, a.oferta FROM articulos a LEFT JOIN marcas m ON m.id = a.id_marca WHERE a.id_marca =22 AND a.id_fam =162 ORDER BY a.oferta DESC) T1UNION SELECT * FROM (SELECT a.nombre, m.marca, a.oferta FROM articulos a LEFT JOIN marcas m ON m.id = a.id_marca WHERE a.id_marca <>22 AND a.id_fam =162 ORDER BY m.marca ASC) t2;