Reputation: 4579
SELECT `idstudii`
FROM (`studii`)
JOIN `studii` ON `mesaje`.`idstudii`=`studii`.`id`
JOIN `users` ON `users`.`id`=`studii`.`idusers`
WHERE `studii`.`idusers` = '1'
I have this sql query which gives me the error "Not unique table/alias". This is not the case as "studii" is the only table with that name. Why does this error show up?
Upvotes: 0
Views: 988
Reputation: 5290
FROM (`studii`)
JOIN `studii`
in this care you are referring to 2 different selections of a table with the same alias (studii)
FROM `studii` AS s1
JOIN `studii` AS s2 ON s2.something2 = s1.something1
Upvotes: 2