title: Yii 2.0 table alias in SQL query
body: <p>I am using Yii2.0 and I have following error when I doing filtering with relationship:</p>
  
  <blockquote>
    <p>Exception (Database Exception) 'yii\db\Exception' with message
    'SQLSTATE[42S22]: Column not found: 1054 Unknown column
    'userContact.email' in 'where clause' The SQL being executed was:
    SELECT <code>tbl_user</code>.* FROM <code>tbl_user</code> LEFT JOIN <code>tbl_user_contact</code> ON
    <code>tbl_user</code>.<code>id</code> = <code>tbl_user_contact</code>.<code>user_id</code> WHERE
    <code>userContact</code>.<code>email</code>='me@me.com'</p>
  </blockquote>
  
  <p>And it is obvious that the table name alias is not given. Following is my code that generate the query above:</p>
  
  <p><strong>Class Files</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>class User extends ActiveRecord{
      public function getUserContacts(){
          return $this-&gt;hasMany(UserContact::className(), ['user_id' =&gt; 'id']);
      }
  }
  </code></pre>
  
  <pre class="lang-php prettyprint-override"><code>class UserContact extends ActiveRecord {
      public function getUser(){
          return $this-&gt;hasOne(User::className(), ['id' =&gt; 'user_id']);
      }
  }
  </code></pre>
  
  <p><strong>Query</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>User::find()-&gt;joinWith('userContacts', false)
      -&gt;where(['userContact.email' =&gt; $email])
      -&gt;one();
  </code></pre>
  
  <p>I follow the instruction given <a href="http://www.yiiframew...in-yii-2-0/#hh4" rel="nofollow noreferrer">here.</a></p>
  
  <p>Is there a way to have the alias in the query?</p>