Questions: what if there are more than three stores... what if there are thousands of stores...?
As stated above, what if there are too many stores to all explicitly write it out and then union? Is there any way to solve it in another way in mysql?\n\n\nSEL
As stated above, what if there are too many stores to all explicitly write it out and then union? Is there any way to solve it in another way in mysql?\n\n```\nSELECT product_id, \'store1\' AS store, store1 AS price \nFROM Products \nWHERE store1 IS NOT NULL\nUNION \nSELECT product_id, \'store2\' AS store, store2 AS price \nFROM Products \nWHERE store2 IS NOT NULL\nUNION \nSELECT product_id, \'store3\' AS store, store3 AS price \nFROM Products \nWHERE store3 IS NOT NULL;   \n```\n
[]