SELECT semen.idmare,semen.identification,; cv_gender.name as namemare,; cv_name.name as namehorse,; semen.value; FROM semensales semen; JOIN cv cv_name ON semen.identify=cv_name.idfield; JOIN cv cv_gender ON semen.idmare=cv_gender.idfield; ORDER BY semen.idmare,semen.identify>The problem is that i have two IDs in the table SEMENSALES pointing to the same id on table CV, let me explain you with this example: