-
Notifications
You must be signed in to change notification settings - Fork 34
/collection/{slug}/estimation: optimize summing of prices #888
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
Labels
Milestone
Comments
The puzzle |
Here is the sql query for that: select sum(price) as total,currency from collections_series where price is not null group by currency;
+---------+----------+
| total | currency |
+---------+----------+
| 300.00 | EUR |
| 2137.50 | RUB |
| 150.00 | USD |
+---------+----------+
3 rows in set (0.00 sec) |
Yet another way is to use window functions and get total price together with data:
But such data list will be hard to process from within Thymeleaf, so we can apply a little transformation on DAO layer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The puzzle
884-03637f5c
from #884 has to be resolved:mystamps/src/main/webapp/WEB-INF/views/collection/estimation.html
Line 119 in 9287473
The puzzle was created by Slava Semushin on 20-Jun-18.
The text was updated successfully, but these errors were encountered: