【问题标题】:Removing integer from JSON column using JSON_REMOVE使用 JSON_REMOVE 从 JSON 列中删除整数
【发布时间】:2019-10-17 11:14:43
【问题描述】:

我想在不知道其数组位置的情况下从列 access(类型 json)中删除数字 6。

示例access 第 1 行:[1, 2, 3, 4, 5, 6, 7, 8, 9]


CREATE TABLE example (
    id int NOT NULL AUTO_INCREMENT,
    access json NOT NULL,
    PRIMARY KEY (id)
);

INSERT INTO `example` (`access`) VALUES ('[1, 2, 3, 4, 5, 10, 20, 30]');

SELECT * FROM `example`;

SELECT JSON_SEARCH(`access`, 'one', '30') from `example`;

JSON_SEARCH 不返回任何结果。

【问题讨论】:

    标签: php mysql server


    【解决方案1】:

    您可能已经继续前进,但如果其他人发现自己处于与我相同的位置,尝试搜索整数数组...JSON_SEARCH 不支持该功能。

    https://bugs.mysql.com/bug.php?id=79233

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 1970-01-01
      • 2021-08-07
      • 1970-01-01
      相关资源
      最近更新 更多