-
Notifications
You must be signed in to change notification settings - Fork 109
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
Question: How do I do sum() or other aggregate functions on columns that is of type money #105
Comments
I have transactions like this
and if I do like this:
the result is 0 |
You cannot sum a json string. this become tricky. you need to get all the record first and then sum it via laravel collection.
this will be heavy if you have many records, it is recommended to cache your sum in parent reords. You can also use json_extract functions from mysql
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
Do you have an example on how to doe e.g. a sum() of records that have Money as a column type ?
The text was updated successfully, but these errors were encountered: