How to create a query in Wappler, so that the output is formed according to the condition - if the records have the same names field 1 and field 2, the records are combined into one, and the values of the fields with the number of units are added. It looks like this:
Strongly do not scold. So far I am weak in working with the database.
field1 == field2 is not the condition I wrote about in the first message.
I need a condition when the records have the same values both on field1 and on field2, then the records merge and the numeric values add up, as shown in the screenshot.
And I would really appreciate it if you would describe the process in more detail what I need to do in Wappler step by step.
So you want to group by field 1 and field 2. A custom query would look like:
SELECT field1, field2, SUM(field3) FROM table GROUP BY field1, field2
You can do this with the custom query or with the query builder, just use the aggregate function SUM on the field3 and it will automaticly group by the other fields you select in the output.
I apologize that did not answer at once, only now reached implementation of this query. I come a little problem: I made a query using the query Builder, following your instructions. The query combines the rows exactly as I need, but for some reason the field in which the total number (SUM) should be displayed is empty. What can it be related to and how to fix it?