I'd like to make all possible combinations of "FRUIT" and calculate the SUM of "price."
INSERT INTO MARKET(FRUIT, PRICE) VALUES ("APPLE", 2) ,("BANANA", 3) ,("GRAPE", 1)
In this case, the combinations that can be made in the "MARKET" are "APPLE", "BANANA", "GRAPE", "APPLE+BANANA", "APPLE+GRAPE", "BANANA+GRAPE", and "APPLE+BANANA+GRAPE".
So I want to select a table like the one below.
"APPLE" 2
"BANANA" 3
"GRAPE" 1
"APPLE+BANANA" 5
"APPLE+GRAPE"3
"BANANA+GRAPE" 4
"APPLE+BANANA+GRAPE" 6
Is it possible to make the given table to the table above?