vendredi 28 juillet 2017

transform raw query with subqueries to eloquent

I have the following working query with a subquery which works fine I would like to transfrom to Eloquent because I would like persevere other relaiont of my User model

select * from (
select p.from, a.account_id, count(*) as num
from accounts as a
inner join accounts_prop as p on (a.account_id = p.account_id)
group by p.account_id 
having num = 1 ) query

where year(query.von) = 2017

How would I start the select



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire