jeudi 31 mars 2016

How to execute MYSQL query in laravel?

I have one MYSQL query with me I want to execute this query in 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

Please guide me how do i Do it easily.

I have one reference with me.... It is not working

$update = DB::table('tags')
->select('t_id', 'u_id', DB::raw('count(*) as total'))
->whereIn('t_id',$tags)
->where('total','=',count($tags))
->groupBy('u_id')
->lists('u_id');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire