We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it posisble to a make a query that do a sum with if inside?
For example :
SUM(if( users.origin IS NULL, 1,0))
Checked the documentation but don't find the if statement, there is a workaround?
The text was updated successfully, but these errors were encountered:
Hello,
Could you show me the full query you want to perform, including the model you are querying against?
You could use a virtual column: https://github.com/asterite/rgviz-rails#virtual-columns
So you would do:
render :rgviz => User, :virtual_columns => { 'user_origin_is_null' => { :sql => "case when users.origin is null then 1 else 0 end", :type => :string } }
I'm not sure you can do "if" in SQL (in GQL I know you can't)
Sorry, something went wrong.
No branches or pull requests
Is it posisble to a make a query that do a sum with if inside?
For example :
Checked the documentation but don't find the if statement, there is a workaround?
The text was updated successfully, but these errors were encountered: