Ver originalselect t1.idcompra, t2.nombre from compras as t1join clientes as t2 on (t1.idcliente=t2.idcliente)