mercredi 28 août 2019

How to make Multiple sub query in Laravel

I am new in Laravel. Here below i mention my code how to make this in laravel query builder.

Using tables are ab,cd,ef,gh,ij

SELECT ab.* FROM ab WHERE ab.id IN (SELECT ab_id FROM cd WHERE ef_id = 1 AND status = 1 AND deleted_at IS NULL AND ab_id IN (SELECT ab_id FROM gh WHERE ij_id IN (SELECT id FROM ij WHERE ef_id = 1 AND deleted_at IS NULL) AND deleted_at IS NULL) AND ab_id IN (SELECT id FROM ab WHERE deleted_at IS NULL AND usertest != 1)) AND ab.deleted_at IS NULL GROUP BY ab.id ORDER BY ab.created_at DESC;



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LgVGKh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire