mariadb remove prop json

Solutions on MaxInterview for mariadb remove prop json by the best coders in the world

showing results for - "mariadb remove prop json"
Lloyd
29 Mar 2019
1+----+--------+-------+-------+---------------------------------+
2| id | name   | price | stock | attr                            |
3+----+--------+-------+-------+---------------------------------+
4|  2 | Shirt  | 10.50 |    78 | {"size": 42, "colour": "white"} |
5|  3 | Blouse | 17.00 |    15 | {"colour": "white"}             |
6+----+--------+-------+-------+---------------------------------+
7
8UPDATE
9  Clothes
10SET
11  attr = JSON_REMOVE(attr, '$.size');
12WHERE
13	id = 2;
14    
15+----+--------+-------+-------+---------------------------------+
16| id | name   | price | stock | attr                            |
17+----+--------+-------+-------+---------------------------------+
18|  2 | Shirt  | 10.50 |    78 | {"colour": "white"} 			|
19|  3 | Blouse | 17.00 |    15 | {"colour": "white"} 			|
20+----+--------+-------+-------+---------------------------------+