【问题标题】:Select rows where json array contains specific element选择 json 数组包含特定元素的行
【发布时间】:2021-12-20 04:29:57
【问题描述】:

我在 Oracle DB 中有一个带有 JSON 列的表。该列是整数数组:

CREATE TABLE orders (
    id NUMBER,
    products CLOB CHECK (products IS JSON)
);
INSERT INTO orders VALUES (1, '[5, 8, 12]');
INSERT INTO orders VALUES (2, '[3, 7, 19]');

例如,我想选择 products 数组包含数字 8 的行。正确的 SQL 查询是什么?

【问题讨论】:

    标签: sql arrays json oracle contains


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2020-11-25
    • 2017-05-21
    • 2017-09-20
    • 2018-05-01
    • 2016-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多