Hi!
I would like to know how GroupBy works. I have a 1-many relationship (invoice-products)
I have this query:
[OPERATION_ID], DESCRIPTION: [PRODUCT NAME] & [PRODUCT TYPE], [QUANTITY]
What I would like is to have a group by DESCRIPTION since some products may be repeated in a same OPERATION cuz they are from dif origin but in the invoice they gotta be merged.
So if I have:
1 | GARLIC WHITE | 20
1 | GARLIC WHITE | 20
1 | ONION RED | 20
2 | GARLIC WHITE | 20
2 | POTATOE RED | 20
The query should return
1 | GARLIC WHITE | 40
1 | ONION RED | 20
2 | GARLIC WHITE | 20
2 | POTATOE RED | 20
With this I mean: If DESCRIPTION (product and product type) are the same, group them Per OPERATION_ID and Sum QUANTITIES
I would like to know how GroupBy works. I have a 1-many relationship (invoice-products)
I have this query:
[OPERATION_ID], DESCRIPTION: [PRODUCT NAME] & [PRODUCT TYPE], [QUANTITY]
What I would like is to have a group by DESCRIPTION since some products may be repeated in a same OPERATION cuz they are from dif origin but in the invoice they gotta be merged.
So if I have:
1 | GARLIC WHITE | 20
1 | GARLIC WHITE | 20
1 | ONION RED | 20
2 | GARLIC WHITE | 20
2 | POTATOE RED | 20
The query should return
1 | GARLIC WHITE | 40
1 | ONION RED | 20
2 | GARLIC WHITE | 20
2 | POTATOE RED | 20
With this I mean: If DESCRIPTION (product and product type) are the same, group them Per OPERATION_ID and Sum QUANTITIES