title: Error Code: 1054. Unknown column
body: <p>I have the following SQL statement: </p>
  
  <pre><code>SELECT efforts.user_id, project_tasks.task_name, sum(hours) 
  FROM efforts, users, project_tasks
  INNER JOIN PROJECT_TASKS pu ON efforts.project_task_id = pu.id  
  INNER JOIN USERS u ON efforts.users_id = u.id
  WHERE project_tasks.project_id = '2'; 
  </code></pre>
  
  <p>And when I run it I get the following error: </p>
  
  <pre><code>Error Code: 1054. Unknown column 'efforts.project_task_id' in 'on clause'
  </code></pre>
  
  <p>Why am I getting this error?</p>
  
  <p><img src="https://imgur.com/zcoIw" alt=""></p>
  
  <p>Project_task_id belongs to efforts table </p>
  
  <p><a href="https://imgur.com/zcoIw" rel="nofollow noreferrer">Image of my efforts table</a></p>
  
  <p>Updated: </p>
  
  <pre><code>SELECT u.full_name, pu.task_name, hours 
  FROM efforts
  INNER JOIN project_tasks pu ON efforts.project_task_id = pu.id   
  INNER JOIN users u ON efforts.user_id = u.id 
  GROUP BY user_id, task_name
  </code></pre>