title: YIi2 get records not contained in another table
body: <p>I would like to retrieve records in one table not contained in another</p>
  
  <p>I have two tables</p>
  
  <pre><code>tb_users having columns
     id(primary key) 
     username, 
     firstname, 
  
  2. tbl_paychecks
       id(primary key)
       user_id(foreignkey)
       amount
       created_at
       ...
  </code></pre>
  
  <p>NOw i would like to retrieve all the users without paychecks that it all tbl_users whose id's are not in the tbl_paychecks</p>
  
  <p>So in my users model</p>
  
  <pre><code>public function getNOPaychecks()
    {
      return self::find()
        -&gt;leftJoin('tbl_paychecks','`tbl_paychecks`.`user_id` != `tbl_user`.`id`')
         -&gt;where(['tbl_paycheks.user_id'=&gt;null])
         -&gt;all();
     }
  </code></pre>
  
  <p>But the above still returns an error of </p>
  
  <pre><code>unknown column tbl_paycheks.user_id in 'where clause
  </code></pre>
  
  <p>Where am i going wrong?</p>