php - Running “exists” queries in Laravel query builder -
i'm trying execute :
select * `lms_test` not exists (select * `lms_studenttest` `lms_test`.slug = `lms_studenttest`.testid , `lms_studenttest`.`studentid`='10a75c804b8851520993dedc42334c0f' ) , `lms_test`.`testtype`= 'practice test'
but not getting success.
me this.
i think can try example :
a::wherenotexists(function($query){ $query->select(db::raw(1)) ->from('b') ->whereraw('a.id = b.id'); }) ->get();
or
db::table('lms_test') ->wherenotexists(function ($query) { $query->select('lms_studenttest.*') ->from('lms_studenttest') ->where('lms_test.testtype', 'practice test') ->where('lms_studenttest.studentid', '10a75c804b8851520993dedc42334c0f') ->whereraw('lms_studenttest.testid = lms_test.slug'); }) ->get();
hope !!!
Comments
Post a Comment