Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can a filter be made with having() #284

Open
dertin opened this issue Dec 17, 2018 · 1 comment
Open

How can a filter be made with having() #284

dertin opened this issue Dec 17, 2018 · 1 comment
Labels

Comments

@dertin
Copy link

dertin commented Dec 17, 2018

Hello, the following is what I want to do:

SELECT *
FROM testing
GROUP BY foo
HAVING COUNT(foo) > 1

but it does not work.

$mapperTesting->all()->group(['foo'])->having(['COUNT(foo)' => '> 1'])->toArray();

Regards,

@FlipEverything
Copy link
Contributor

I am really sorry for the late reply, but have you tried this?

$mapperTesting->all()->group(['foo'])->having(['COUNT(foo) >' => '1'])->toArray();

It translates to:

GROUP BY test_posts.status HAVING COUNT(status) >  ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants