我有一个MYSQL查询语句,我想在Laravel中执行这个查询。
select d1.update_id from ( select update_id, count(update_id)
as ct from updates_tags where tag_id in
(67,33,86,55) group by update_id) as d1 where d1.ct=4
请指导我如何轻松地完成它。我手头有一个参考资料,但它无法正常工作。
$updateArray = DB::table('updates_tags')
->select('update_id', DB::raw('count(*) as update_id'))
->whereIn('tag_id',$jsontags)
->groupBy('update_id')
->having('update_id','=',count($jsontags))
->lists('update_id');