trivias_Users
Código:
trivias_UserAnswers+-----------+-------------+-----------+---------------+---------------+ | user_FBid | user_NickFB | trivia_id | user_fullname | user_details | +-----------+-------------+-----------+---------------+---------------+ | 7878 | pepegomez | 01 | jose gomez | bla bla bla | | 7878 | pepegomez | 02 | jose gomez | ye ye ye | +-----------+-------------+-----------+---------------+---------------+
Código:
Quiero traer los datos del usuario de un user_FBid que coincida con la trivia 01en ambas tablas, pero si traigo los datos de la trivia 01 en trivias_Users me trae los datos de la trivia 02 en trivias_UserAnswers y viceversa+-----------+-----------+---------------+------------------+--+ | user_FBid | trivia_id | answer_values | answer_reception | | +-----------+-----------+---------------+------------------+--+ | 7878 | 01 | A,B,C | date 1 | | | 7878 | 02 | B,B,B | date 2 | | +-----------+-----------+---------------+------------------+--+
Código SQL:
[/php]Ver original
SELECT trivias_Users.user_FBid, trivias_Users.user_nickFB, trivias_Users.user_fullname, trivias_UserAnswers.trivia_ID, trivias_UserAnswers.user_FBid, trivias_UserAnswers.answer_values, trivias_UserAnswers.answer_reception FROM trivias_Users INNER JOIN trivias_UserAnswers ON trivias_Users.user_FBid = trivias_UserAnswers.user_FBid WHERE trivias_UserAnswers.trivia_ID =02 GROUP BY trivias_Users.user_FBid ORDER BY trivias_UserAnswers.answer_reception
Es posible que la condición WHERE traiga dos columnas?
Código SQL:
[/html] Ver original
WHERE trivias_UserAnswers.trivia_ID = 02 AND trivias_User.trivia_ID = 02