title: Integrity constraint violation: 1052 Column and in where clause is ambiguous
body: <p>I have two table the <code>Tbl_payroll_leave_employeev2</code> and <code>tbl_payroll_leave_schedulev2</code> and i want to <code>join</code> them but im getting an error like this</p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'payroll_leave_employee_id' in where clause is ambiguous (SQL: select <code>payroll_employee_id</code> from <code>tbl_payroll_leave_employee_v2</code> inner join <code>tbl_payroll_leave_schedulev2</code> on <code>tbl_payroll_leave_employee_v2</code>.<code>payroll_leave_employee_id</code> = <code>tbl_payroll_leave_schedulev2</code>.<code>payroll_leave_employee_id</code> where <code>payroll_leave_employee_id</code> = 5) ◀</p>
  </blockquote>
  
  <p>My table structure
  <a href="https://i.stack.imgur.com/UK4bV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UK4bV.png" alt="enter image description here"></a></p>
  
  <pre class="lang-php prettyprint-override"><code>$employee_id = Tbl_payroll_leave_employeev2::select('payroll_employee_id')
     -&gt;join('tbl_payroll_leave_schedulev2','tbl_payroll_leave_employee_v2.payroll_leave_employee_id','=','tbl_payroll_leave_schedulev2.payroll_leave_employee_id')
     -&gt;where('payroll_leave_employee_id',$emp)
     -&gt;get();
  </code></pre>