(SELECT * FROM table1
INNER JOIN table2
ON table1.id = table2.id)
AS t1
JOIN (SELECT ROUND(RAND() * (SELECT MAX(table1.id) FROM table1)) AS id)
AS t2
WHERE t1.id >= t2.id
LIMIT 1)
J'essaie d'utiliser RAND()
max(id)
pour obtenir un résultat mysql au hasard, mais obtenir une erreur #1064
.mysql jointure interne erreur de syntaxe aléatoire
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS t1 JOIN (SELECT ROUND(RAND() * (SELECT MAX(table1.id) FROM table1))' at line 1
Où est le problème? Merci.
est-ce la question entière? –