MySQL Forums
Forum List  »  Spanish

Re: Pregunta sobre un sql rarisimo
Posted by: Miguel Perez
Date: September 14, 2007 06:57AM

Más que no devolver registros lo que devuelve es un error. En la última línea, comprueba que en vez de t2a no querías decir t1a. La consulta quedaría así:

SELECT IFNULL(t2.id, 0), IFNULL(t2.count, 0), t1a.*, t1b.* FROM table2 t2 RIGHT JOIN table1 t1a ON t1a.id = t2.table1Rel1 AND t1a.typec = '1' RIGHT JOIN table1 t1b ON t1b.id = t2.table1Rel2 AND t1a.typec = '0'

Un saludo,

Miguel Pérez
Afina Sistemas - Partner de MySQL en España

Options: ReplyQuote


Subject
Views
Written By
Posted
3178
September 12, 2007 08:32PM
Re: Pregunta sobre un sql rarisimo
2132
September 14, 2007 06:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.