<center id="qkqgy"><optgroup id="qkqgy"></optgroup></center>
  • <menu id="qkqgy"></menu>
    <nav id="qkqgy"></nav>
    <xmp id="qkqgy"><nav id="qkqgy"></nav>
  • <xmp id="qkqgy"><menu id="qkqgy"></menu>
    <menu id="qkqgy"><menu id="qkqgy"></menu></menu>
    <tt id="qkqgy"><tt id="qkqgy"></tt></tt>

  • 1、查詢jsonb字段不為null
    SELECT ID, watcher :: json ->> 'processRouteWorkstations' AS workstations FROM
    mo_mfg_order WHERE enabled = TRUE AND mfg_order_status_enum !=
    'MfgOrderStatus.unReleased' AND watcher ->'processRouteWorkstations' is not
    null AND deleted = FALSE
    注意,會返回{}空json的行

    2、查詢json字段不為{}?
    SELECT ID, watcher :: json ->> 'processRouteWorkstations' AS workstations FROM
    mo_mfg_order WHERE enabled = TRUE AND mfg_order_status_enum !=
    'MfgOrderStatus.unReleased' AND watcher->'processRouteWorkstations' != '{}' AND
    deleted = FALSE;

    ?3、查詢包含某key的數據,結果和is not null示例1相同
    SELECT ID, watcher :: json ->> 'processRouteWorkstations' AS workstations FROM
    mo_mfg_order WHERE enabled = TRUE AND mfg_order_status_enum !=
    'MfgOrderStatus.unReleased' AND jsonb_exists(watcher,
    'processRouteWorkstations') AND deleted = FALSE;

    4、刪除某個屬性
    UPDATE bc_process_route SET extra = jsonb_delete ( extra, 'nodes' ) WHERE ID =
    1425995628128104449;
    5、向json字段中添加屬性
    UPDATE bc_process_route SET extra = extra || '{"name":"penn"}' :: jsonb WHERE
    ID = 1425995628128104449; UPDATE bc_process_route SET extra = extra ||
    '{"age":10}' :: jsonb WHERE ID = 1425995628128104449;

    ?6、也可以用上面的方式修改某個屬性
    UPDATE bc_process_route SET extra = extra || '{"name":"penn"}' :: jsonb WHERE
    ID = 1425995628128104449;

    ?7、查詢包含json
    SELECT ID , extra FROM bc_process_route WHERE jsonb_contains ( extra,
    '{"name": "penn"}' )

    ?8、查詢包含于某個json內容
    SELECT ID , extra FROM bc_process_route WHERE jsonb_contained ( extra,
    '{"name": "penn", "age": 10, "address": "shanghai"}' )

    ?暫時先記錄這幾個,后面再遇到再記錄

    技術
    下載桌面版
    GitHub
    百度網盤(提取碼:draw)
    Gitee
    云服務器優惠
    阿里云優惠券
    騰訊云優惠券
    華為云優惠券
    站點信息
    問題反饋
    郵箱:ixiaoyang8@qq.com
    QQ群:766591547
    關注微信
    巨胸美乳无码人妻视频