这是我的mysql代码
SELECT name,lastname FROM employee WHERE employee.id_employee
NOT IN (SELECT assistancea.id_employee FROM assistance WHERE assistance.id_meeting=3)
我在等待3号的值 3是会议的id_meeting
table employe
|id_employe|name|lastname
table assistance
|id_employe|id_meetign|
table meeting
|id_metting|description|date
你可以帮我从laravel进行查询
答案 0 :(得分:0)
我是为你写的。
DB::table('employee AS employee')
->select(['employee.name','employee.lastname'])
->whereNotExists(function ($query) {
$query->select(DB::raw(1))
->from('assistance AS assistance')
->where('assistance.id_meeting','=',3)
->whereRaw('employee.id_meeting = assistance.id_meeting');
})->get();