我有兩個表的Tbl_payroll_leave_employeev2
和tbl_payroll_leave_schedulev2
,我想join
他們,但即時得到類似這樣的錯誤完整性約束違規:1052列和where子句是曖昧
「SQLSTATE [23000]:完整性約束違規:1052列 'payroll_leave_employee_id' 在where子句是不明確的(SQL:選擇payroll_employee_id
從tbl_payroll_leave_employee_v2
內上tbl_payroll_leave_employee_v2
加入tbl_payroll_leave_schedulev2
payroll_leave_employee_id
= tbl_payroll_leave_schedulev2
payroll_leave_employee_id
其中payroll_leave_employee_id
= 5。)◀」
$employee_id = Tbl_payroll_leave_employeev2::select('payroll_employee_id')
->join('tbl_payroll_leave_schedulev2','tbl_payroll_leave_employee_v2.payroll_leave_employee_id','=','tbl_payroll_leave_schedulev2.payroll_leave_employee_id')
->where('payroll_leave_employee_id',$emp)
->get();
謝謝:)先生 – nethkennnnn