| panel | alert | date |
|---|---|---|
| X | [{"name":"x1","user_text":"","user_text_overflow":""},{"name":"y1","user_text":"","user_text_overflow":""},{"name":"z1","user_text":"","user_text_overflow":""}] | 2024-12-10 |
| X | [{"name":"x2","user_text":"","user_text_overflow":""},{"name":"x1","user_text":"","user_text_overflow":""},{"name":"z2","user_text":"","user_text_overflow":""}] | 2024-12-10 |
| X | [{"name":"x1","user_text":"","user_text_overflow":""},{"name":"x2","user_text":"","user_text_overflow":""},{"name":"x3","user_text":"","user_text_overflow":""}] | 2024-12-11 |
Given the table above, I am trying to extract the "name" value when its set to "x1". I have tried using json_extract_scalar but I keep getting NULL values. I also want to get a sum of the number of times "name" is "x1" on a given date
The expected outcome given the example above should be:
| panel | name = x1 | date |
|---|---|---|
| X | 2 | 2024-12-10 |
| X | 1 | 2024-12-11 |