Subquery returns more than 1 row
Bonjour,
J'ai fais une requete assez "complexe" et la plus j'avance plus je bloque :cry: !
Code:
1 2 3 4 5 6 7
|
SELECT user.*, SUM(thread.upload) AS tot, SUM(thread_mois.upload) AS mois, SUM(thread_lastm.upload) AS lastm FROM user
LEFT JOIN thread AS thread ON (user.userid=thread.postuserid AND thread.postuserid=user.userid)
LEFT JOIN thread AS thread_mois ON (user.userid=thread_mois.postuserid AND thread_mois.postuserid=user.userid AND (SELECT dateline FROM thread WHERE dateline>= " . $debut_mois . "))
LEFT JOIN thread AS thread_lastm ON (user.userid=thread_lastm.postuserid AND thread_lastm.postuserid=user.userid AND (SELECT dateline FROM thread WHERE dateline>= " . $debut_lastm . " AND dateline<= " . $fin_lastm . "))
GROUP BY user.userid
ORDER BY tot DESC |
Mon erreur est a cause des deux AND (SELECT dateline...) !
Voici l'erreur que me retourne MySQL:
Citation:
Subquery returns more than 1 row
Si quelqu'un saurait me débloquer...
Merci beaucoup,
Cordialement,
Mathieu.