I need to fix following query:
SELECT *
FROM message_treads
LEFT JOIN usernames ON usernames.uid=message_treads.uid_1
LEFT JOIN usernames ON usernames.uid=message_treads.uid_2
I know i should use aliases, but i am not sure on how to do it here. I know how to do it when there is only one left join of one table, but how to to it when there are more than one?
You are correct, you need to use aliases like so: