title: MySQL error 1054 unknown column
body: <p>I have 2 tables.</p>
  
  <ol>
  <li>t_problem</li>
  <li>t_riesenia</li>
  </ol>
  
  <p>In t_problem I have primary key <code>id</code>.<br>
  In t_riesenia I have foreign key <code>ProblemID</code>. At least I think I have.<br>
  I want to select all fields from table <code>t_problem</code> where there is a solution in <code>t_riesenia</code> (there is a<code>ProblemID</code> in <code>t_riesenia</code> equal to <code>id</code> in <code>t_problem</code>)</p>
  
  <p>When trying to execute SQL statement :  </p>
  
  <pre><code>SELECT * FROM `t_problem` where `t_problem`.`id`=`t_riesenia`.`ProblemID`  
  </code></pre>
  
  <p>I get an error : </p>
  
  <blockquote>
    <p>Error Code: 1054. Unknown column 't_riesenia.ProblemID' in 'where clause'  </p>
  </blockquote>
  
  <p>Why? See screenshots from MySQL workbench below.  </p>
  
  <p><strong>t_problem</strong>
  <a href="https://i.stack.imgur.com/xQVar.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xQVar.png" alt="t_problem"></a>  </p>
  
  <p><strong>t_riesenia</strong>
  <a href="https://i.stack.imgur.com/x7Ego.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x7Ego.png" alt="t_riesenia"></a>  </p>
  
  <p><strong>t_riesenia Foreign key</strong><br>
  <a href="https://i.stack.imgur.com/8XKQF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8XKQF.png" alt="t_riesenia Foreign key"></a></p>