2015-02-06 63 views

回答

13

可以使用whereNotIn與閉合:

$result = DB::table('exams')->whereNotIn('id', function($q){ 
    $q->select('examId')->from('testresults'); 
})->get(); 
+0

我還需要添加 - >獲得()在結束了嗎? – 2015-02-06 08:36:41

+0

哦,是的,當然... – lukasgeiter 2015-02-06 08:37:24

+0

謝謝隊友!得到它的工作 – 2015-02-06 08:38:17