mardi 12 février 2019

Laravel eloquent subquery alias

How to do this in Laravel 5.1?

SELECT *
FROM
(
    SELECT subscriber_id, COUNT(*) as count
        FROM mailing_group_subscriber
        WHERE mailing_group_id IN ('99', '15498855416270870')
    GROUP BY subscriber_id
) table_count
WHERE count = 2;

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire