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

Add Having clause #19

Open
fdncred opened this issue Feb 12, 2020 · 3 comments
Open

Add Having clause #19

fdncred opened this issue Feb 12, 2020 · 3 comments

Comments

@fdncred
Copy link

fdncred commented Feb 12, 2020

Sometimes I need the ability to find duplicates in a CSV file. RBQL would be great for this if it supported the having clause.

Here's my example usage.
select a2, count(*) group by a2 where NR > 1 having count(*) > 1

BTW - RBQL is a great helper. Thanks for it!
I forgot to mention that I'm using Rainbow CSV in vscode.

@mechatroner
Copy link
Owner

Thanks for the feedback!
And thank you for the proposal, I guess it would be possible to implement HAVING, but I haven't look deep into this yet.
BTW you can emulate HAVING with two consecutive queries: first GROUP BY, and then WHERE on the result set of GROUP BY, although this is not an elegant solution.

@fdncred
Copy link
Author

fdncred commented Feb 13, 2020

Thanks @mechatroner for the tip. Would you mind showing me an example of how to have two consecutive queries like you're suggesting?

@fdncred
Copy link
Author

fdncred commented Feb 13, 2020

oh, wait. You may mean just get the results of the first query and then run another query on those results. I thought you were saying to do it with one rbql statement.

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

No branches or pull requests

2 participants