DabasarusRex
New member
0
0%
3
Months of Service
0%
Hello, I have a problem that I can't solve, and I can't figure out the source of the problem. I'm getting the #1066 - Not unique table/alias: 'y' error in my MySQL query. When I searched on the internet, I saw that the "Not unique table/alias" error is resolved using table aliases, but despite my attempts, I continue to get the same error. Where am I going wrong? The error occurs in this line of code: "#1066 - Not unique table/alias: 'y'". The table relationship diagram looks like this:
SELECT * FROM brands AS b, authorized AS y, event AS e, reservation AS r
LEFT JOIN authorized AS y ON y.authorized_id = e.org_authorized_id
AND LEFT JOIN authorized AS y ON y.authorized_id = r.res_authorized_id
LEFT JOIN brands AS b ON b.brand_id = e.org_brand_id
AND LEFT JOIN brands AS b ON b.brand_id = r.res_brand_id
ORDER BY b.brand_id DESC
SELECT * FROM brands AS b, authorized AS y, event AS e, reservation AS r
LEFT JOIN authorized AS y ON y.authorized_id = e.org_authorized_id
AND LEFT JOIN authorized AS y ON y.authorized_id = r.res_authorized_id
LEFT JOIN brands AS b ON b.brand_id = e.org_brand_id
AND LEFT JOIN brands AS b ON b.brand_id = r.res_brand_id
ORDER BY b.brand_id DESC