given this output +----+------------+-----------------------+ id datapoint combineddata…
- User
given this output
+----+------------+-----------------------+ | id | data_point | combined_data | +----+------------+-----------------------+ | 1 | Point A | Point A | | 2 | Point B | Point B, Point C | | 2 | Point C | Point B, Point C | | 4 | Point D | Point D, Point E | | 4 | Point E | Point D, Point E | +----+------------+-----------------------+give me a query that will give me this output given this input+----+------------+ | id | data_point | +----+------------+ | 1 | Point A | | 2 | Point B | | 2 | Point C | | 4 | Point D | | 4 | Point E | +----+------------+ - Assistant
SELECT id, data_point, combined_data FROM your_table WHERE combined_data LIKE CONCAT('%', data_point, '%') ORDER BY id, data_point;