SELECT m.id,m.nombre FROM np_fanart.tienda_marcas m, tienda_productos p WHERE m.id=p.id_marca GROUP BY m.nombreUnknown column 'm.nombre' in 'SELECT'