Nominating the same table in a comma-JOIN and an explicit JOIN emits error: "Not unique table/alias"
14:30 17 Dec 2014

I have 3 tables:

  • user,
  • user_authority_rules_history,
  • authority_rules_history

I want to select values from two of the tables if they match my criteria.

My query looks like this

SELECT 
    user_authority_rules_history.download_date, 
    authority_rules_history.* 
FROM 
    user_authority_rules_history, 
    authority_rules_history 
LEFT JOIN 
    user_authority_rules_history 
    ON 
        user_authority_rules_history.authority_rule_id = authority_rules_history.id 
LEFT JOIN 
    user 
    ON 
        user_authority_rules_history.user_id = user.id 
WHERE 
    user.id = 1

I'm able make it work, if I leave out user_authority_rules_history.download_date from my query, but then I'm obviously missing that data. What am I doing wrong here?

mysql join mysql-error-1066