{"id":99391,"date":"2026-09-02T15:04:18","date_gmt":"2026-09-02T07:04:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99391.html"},"modified":"2026-09-02T15:04:18","modified_gmt":"2026-09-02T07:04:18","slug":"dm8-sql%e8%af%ad%e8%a8%80%e4%b8%adjson%e5%87%bd%e6%95%b0%e5%ae%9e%e6%88%98%ef%bc%9a%e9%ab%98%e6%95%88%e5%a4%84%e7%90%86%e5%8d%8a%e7%bb%93%e6%9e%84%e5%8c%96%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99391.html","title":{"rendered":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e"},"content":{"rendered":"<h2>DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218&#xff1a;\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e<\/h2>\n<h3>\u4e00\u3001JSON\u51fd\u6570\u6982\u8ff0\u4e0e\u5e94\u7528\u573a\u666f<\/h3>\n<h4>1.1 JSON\u6570\u636e\u683c\u5f0f\u7b80\u4ecb<\/h4>\n<p>JSON(JavaScript Object Notation)\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f,\u91c7\u7528\u5b8c\u5168\u72ec\u7acb\u4e8e\u8bed\u8a00\u7684\u6587\u672c\u683c\u5f0f,\u6613\u4e8e\u4eba\u9605\u8bfb\u548c\u7f16\u5199,\u540c\u65f6\u4e5f\u6613\u4e8e\u673a\u5668\u89e3\u6790\u548c\u751f\u6210\u3002JSON\u57fa\u4e8eJavaScript\u7684\u4e00\u4e2a\u5b50\u96c6,\u662f\u7406\u60f3\u7684\u534a\u7ed3\u6784\u5316\u6570\u636e\u5b58\u50a8\u683c\u5f0f\u3002<\/p>\n<p>#publish-mermaid-1786238291865-0{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238291865-0 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238291865-0 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238291865-0 .error-icon{fill:#552222;}#publish-mermaid-1786238291865-0 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238291865-0 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238291865-0 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238291865-0 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238291865-0 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238291865-0 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238291865-0 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238291865-0 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238291865-0 .marker.cross{stroke:#333333;}#publish-mermaid-1786238291865-0 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238291865-0 p{margin:0;}#publish-mermaid-1786238291865-0 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238291865-0 .cluster-label text{fill:#333;}#publish-mermaid-1786238291865-0 .cluster-label span{color:#333;}#publish-mermaid-1786238291865-0 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238291865-0 .label text,#publish-mermaid-1786238291865-0 span{fill:#333;color:#333;}#publish-mermaid-1786238291865-0 .node rect,#publish-mermaid-1786238291865-0 .node circle,#publish-mermaid-1786238291865-0 .node ellipse,#publish-mermaid-1786238291865-0 .node polygon,#publish-mermaid-1786238291865-0 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238291865-0 .rough-node .label text,#publish-mermaid-1786238291865-0 .node .label text,#publish-mermaid-1786238291865-0 .image-shape .label,#publish-mermaid-1786238291865-0 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238291865-0 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238291865-0 .rough-node .label,#publish-mermaid-1786238291865-0 .node .label,#publish-mermaid-1786238291865-0 .image-shape .label,#publish-mermaid-1786238291865-0 .icon-shape .label{text-align:center;}#publish-mermaid-1786238291865-0 .node.clickable{cursor:pointer;}#publish-mermaid-1786238291865-0 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238291865-0 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238291865-0 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238291865-0 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238291865-0 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238291865-0 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291865-0 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291865-0 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238291865-0 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238291865-0 .cluster text{fill:#333;}#publish-mermaid-1786238291865-0 .cluster span{color:#333;}#publish-mermaid-1786238291865-0 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238291865-0 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238291865-0 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238291865-0 .icon-shape,#publish-mermaid-1786238291865-0 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238291865-0 .icon-shape p,#publish-mermaid-1786238291865-0 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238291865-0 .icon-shape .label rect,#publish-mermaid-1786238291865-0 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291865-0 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238291865-0 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238291865-0 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291865-0 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291865-0 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"nodeLabel\"><\/p>\n<p>JSON\u6570\u636e\u7ed3\u6784<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5bf9\u8c61 Object<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6570\u7ec4 Array<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u57fa\u7840\u503c Value<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>{key: value, &#8230;}<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>[value, value, &#8230;]<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>string<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>number<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>boolean<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>null<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>object<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>array<\/p>\n<p><\/span><\/p>\n<h4>1.2 DM8\u5bf9JSON\u7684\u652f\u6301\u80fd\u529b<\/h4>\n<p>\u8fbe\u68a6\u6570\u636e\u5e93DM8\u63d0\u4f9b\u4e86\u5bf9JSON\u6570\u636e\u7684\u5168\u9762\u652f\u6301,\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u80fd\u529b:<\/p>\n<li>JSON\u6570\u636e\u7684\u5b58\u50a8\u4e0e\u7ba1\u7406<\/li>\n<li>JSON\u8def\u5f84\u8868\u8fbe\u5f0f\u67e5\u8be2(JSONPath)<\/li>\n<li>\u4e30\u5bcc\u7684JSON\u5904\u7406\u51fd\u6570<\/li>\n<li>JSON\u6570\u636e\u4e0e\u5173\u7cfb\u6570\u636e\u7684\u76f8\u4e92\u8f6c\u6362<\/li>\n<li>JSON\u7d22\u5f15\u4f18\u5316<\/li>\n<p>#publish-mermaid-1786238291989-1{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238291989-1 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238291989-1 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238291989-1 .error-icon{fill:#552222;}#publish-mermaid-1786238291989-1 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238291989-1 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238291989-1 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238291989-1 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238291989-1 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238291989-1 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238291989-1 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238291989-1 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238291989-1 .marker.cross{stroke:#333333;}#publish-mermaid-1786238291989-1 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238291989-1 p{margin:0;}#publish-mermaid-1786238291989-1 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238291989-1 .cluster-label text{fill:#333;}#publish-mermaid-1786238291989-1 .cluster-label span{color:#333;}#publish-mermaid-1786238291989-1 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238291989-1 .label text,#publish-mermaid-1786238291989-1 span{fill:#333;color:#333;}#publish-mermaid-1786238291989-1 .node rect,#publish-mermaid-1786238291989-1 .node circle,#publish-mermaid-1786238291989-1 .node ellipse,#publish-mermaid-1786238291989-1 .node polygon,#publish-mermaid-1786238291989-1 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238291989-1 .rough-node .label text,#publish-mermaid-1786238291989-1 .node .label text,#publish-mermaid-1786238291989-1 .image-shape .label,#publish-mermaid-1786238291989-1 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238291989-1 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238291989-1 .rough-node .label,#publish-mermaid-1786238291989-1 .node .label,#publish-mermaid-1786238291989-1 .image-shape .label,#publish-mermaid-1786238291989-1 .icon-shape .label{text-align:center;}#publish-mermaid-1786238291989-1 .node.clickable{cursor:pointer;}#publish-mermaid-1786238291989-1 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238291989-1 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238291989-1 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238291989-1 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238291989-1 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238291989-1 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291989-1 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291989-1 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238291989-1 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238291989-1 .cluster text{fill:#333;}#publish-mermaid-1786238291989-1 .cluster span{color:#333;}#publish-mermaid-1786238291989-1 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238291989-1 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238291989-1 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238291989-1 .icon-shape,#publish-mermaid-1786238291989-1 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238291989-1 .icon-shape p,#publish-mermaid-1786238291989-1 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238291989-1 .icon-shape .label rect,#publish-mermaid-1786238291989-1 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238291989-1 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238291989-1 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238291989-1 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291989-1 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238291989-1 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"nodeLabel\"><\/p>\n<p>DM8 JSON\u652f\u6301<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5b58\u50a8\u80fd\u529b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u80fd\u529b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6784\u5efa\u80fd\u529b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8f6c\u6362\u80fd\u529b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f18\u5316\u80fd\u529b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>CLOB\/VARCHAR\u5b58\u50a8<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON\u7c7b\u578b\u6821\u9a8c<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_PATH\u8def\u5f84\u67e5\u8be2<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6761\u4ef6\u8fc7\u6ee4<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_OBJECT\u6784\u5efa\u5bf9\u8c61<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_ARRAY\u6784\u5efa\u6570\u7ec4<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_TABLE\u8f6c\u5173\u7cfb\u8868<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5173\u7cfb\u6570\u636e\u8f6cJSON<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u51fd\u6570\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u4f18\u5316<\/p>\n<p><\/span><\/p>\n<h4>1.3 JSON\u51fd\u6570\u5e94\u7528\u573a\u666f\u5206\u6790<\/h4>\n<p>JSON\u51fd\u6570\u5728\u5b9e\u9645\u4e1a\u52a1\u4e2d\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u573a\u666f,\u4e3b\u8981\u5305\u62ec:<\/p>\n<li>\u914d\u7f6e\u6570\u636e\u7ba1\u7406:\u5b58\u50a8\u5e94\u7528\u914d\u7f6e\u4fe1\u606f<\/li>\n<li>\u65e5\u5fd7\u6570\u636e\u5904\u7406:\u89e3\u6790\u548c\u67e5\u8be2\u65e5\u5fd7JSON\u5b57\u6bb5<\/li>\n<li>API\u6570\u636e\u4ea4\u4e92:\u5904\u7406\u6765\u81ea\u5916\u90e8\u63a5\u53e3\u7684JSON\u6570\u636e<\/li>\n<li>\u7075\u6d3b\u5b57\u6bb5\u6269\u5c55:\u4f7f\u7528JSON\u5b57\u6bb5\u6269\u5c55\u8868\u7ed3\u6784<\/li>\n<li>\u534a\u7ed3\u6784\u5316\u6570\u636e\u5b58\u50a8:\u5b58\u50a8\u683c\u5f0f\u4e0d\u7edf\u4e00\u7684\u6570\u636e<\/li>\n<p>#publish-mermaid-1786238292127-2{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238292127-2 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292127-2 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292127-2 .error-icon{fill:#552222;}#publish-mermaid-1786238292127-2 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238292127-2 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238292127-2 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238292127-2 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238292127-2 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238292127-2 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238292127-2 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238292127-2 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238292127-2 .marker.cross{stroke:#333333;}#publish-mermaid-1786238292127-2 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238292127-2 p{margin:0;}#publish-mermaid-1786238292127-2 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238292127-2 .cluster-label text{fill:#333;}#publish-mermaid-1786238292127-2 .cluster-label span{color:#333;}#publish-mermaid-1786238292127-2 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238292127-2 .label text,#publish-mermaid-1786238292127-2 span{fill:#333;color:#333;}#publish-mermaid-1786238292127-2 .node rect,#publish-mermaid-1786238292127-2 .node circle,#publish-mermaid-1786238292127-2 .node ellipse,#publish-mermaid-1786238292127-2 .node polygon,#publish-mermaid-1786238292127-2 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292127-2 .rough-node .label text,#publish-mermaid-1786238292127-2 .node .label text,#publish-mermaid-1786238292127-2 .image-shape .label,#publish-mermaid-1786238292127-2 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238292127-2 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238292127-2 .rough-node .label,#publish-mermaid-1786238292127-2 .node .label,#publish-mermaid-1786238292127-2 .image-shape .label,#publish-mermaid-1786238292127-2 .icon-shape .label{text-align:center;}#publish-mermaid-1786238292127-2 .node.clickable{cursor:pointer;}#publish-mermaid-1786238292127-2 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238292127-2 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238292127-2 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238292127-2 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238292127-2 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292127-2 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292127-2 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292127-2 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238292127-2 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238292127-2 .cluster text{fill:#333;}#publish-mermaid-1786238292127-2 .cluster span{color:#333;}#publish-mermaid-1786238292127-2 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238292127-2 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238292127-2 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238292127-2 .icon-shape,#publish-mermaid-1786238292127-2 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292127-2 .icon-shape p,#publish-mermaid-1786238292127-2 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238292127-2 .icon-shape .label rect,#publish-mermaid-1786238292127-2 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292127-2 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238292127-2 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238292127-2 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292127-2 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292127-2 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u7ed3\u6784\u56fa\u5b9a\u534a\u7ed3\u6784\u5316\u4e0d\u5e38\u67e5\u8be2<span class=\"nodeLabel\"><\/p>\n<p>\u4e1a\u52a1\u9700\u6c42<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6570\u636e\u7279\u70b9<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5173\u7cfb\u578b\u5b57\u6bb5<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON\u5b57\u6bb5<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON\u5b58\u50a8<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f7f\u7528JSON\u51fd\u6570\u5904\u7406<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2: JSON_VALUE\/QUERY<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6784\u5efa: JSON_OBJECT\/ARRAY<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8f6c\u6362: JSON_TABLE<\/p>\n<p><\/span><\/p>\n<h3>\u4e8c\u3001\u6838\u5fc3JSON\u51fd\u6570\u8be6\u89e3<\/h3>\n<h4>2.1 JSON_VALUE\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_VALUE\u51fd\u6570\u7528\u4e8e\u4eceJSON\u5b57\u7b26\u4e32\u4e2d\u63d0\u53d6\u6807\u91cf\u503c(\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u5e03\u5c14\u503c\u7b49),\u8fd4\u56de\u5355\u4e2a\u6807\u91cf\u503c\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_VALUE(json_string, json_path)<\/p>\n<p>\u53c2\u6570\u8bf4\u660e:<\/p>\n<li>json_string:JSON\u683c\u5f0f\u7684\u5b57\u7b26\u4e32<\/li>\n<li>json_path:JSON\u8def\u5f84\u8868\u8fbe\u5f0f,\u6307\u5b9a\u8981\u63d0\u53d6\u7684\u503c\u7684\u4f4d\u7f6e<\/li>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u521b\u5efa\u6d4b\u8bd5\u8868<br \/>\nCREATE TABLE json_test (<br \/>\n    id INT,<br \/>\n    info CLOB<br \/>\n);<br \/>\n&#8212; \u63d2\u5165\u6d4b\u8bd5\u6570\u636e<br \/>\nINSERT INTO json_test VALUES (1, &#039;{&#034;name&#034;: &#034;zhangsan&#034;, &#034;age&#034;: 30, &#034;city&#034;: &#034;beijing&#034;}&#039;);<br \/>\nINSERT INTO json_test VALUES (2, &#039;{&#034;name&#034;: &#034;lisi&#034;, &#034;age&#034;: 25, &#034;city&#034;: &#034;shanghai&#034;}&#039;);<br \/>\n&#8212; \u4f7f\u7528JSON_VALUE\u63d0\u53d6\u503c<br \/>\nSELECT id, JSON_VALUE(info, &#039;$.name&#039;) AS name,<br \/>\n       JSON_VALUE(info, &#039;$.age&#039;) AS age,<br \/>\n       JSON_VALUE(info, &#039;$.city&#039;) AS city<br \/>\nFROM json_test;<\/p>\n<p>JSON\u8def\u5f84\u8868\u8fbe\u5f0f\u8bf4\u660e:<\/p>\n<p>| \u8def\u5f84\u8868\u8fbe\u5f0f | \u542b\u4e49 | \u793a\u4f8b |<\/p>\n<p>| &#8212; | &#8212; | &#8212; |<\/p>\n<p>| $ | \u6839\u5bf9\u8c61 | $ |<\/p>\n<p>| $.key | \u5bf9\u8c61\u5c5e\u6027 | $.name |<\/p>\n<p>| $.key.subkey | \u5d4c\u5957\u5c5e\u6027 | $.address.city |<\/p>\n<p>| $.key[index] | \u6570\u7ec4\u5143\u7d20 | $.hobbies[0] |<\/p>\n<p>| $.key[] | \u6240\u6709\u6570\u7ec4\u5143\u7d20 | $.hobbies[] |<\/p>\n<h4>2.2 JSON_QUERY\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_QUERY\u51fd\u6570\u7528\u4e8e\u4eceJSON\u5b57\u7b26\u4e32\u4e2d\u63d0\u53d6\u5bf9\u8c61\u6216\u6570\u7ec4\u7247\u6bb5,\u8fd4\u56deJSON\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_QUERY(json_string, json_path)<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u63d2\u5165\u5305\u542b\u6570\u7ec4\u548c\u5d4c\u5957\u5bf9\u8c61\u7684\u6570\u636e<br \/>\nINSERT INTO json_test VALUES (3, &#039;{<br \/>\n    &#034;name&#034;: &#034;wangwu&#034;,<br \/>\n    &#034;age&#034;: 28,<br \/>\n    &#034;hobbies&#034;: [&#034;reading&#034;, &#034;swimming&#034;, &#034;coding&#034;],<br \/>\n    &#034;address&#034;: {<br \/>\n        &#034;city&#034;: &#034;guangzhou&#034;,<br \/>\n        &#034;street&#034;: &#034;zhongshan road&#034;<br \/>\n    }<br \/>\n}&#039;);<br \/>\n&#8212; \u63d0\u53d6\u6570\u7ec4<br \/>\nSELECT JSON_QUERY(info, &#039;$.hobbies&#039;) AS hobbies<br \/>\nFROM json_test WHERE id &#061; 3;<br \/>\n&#8212; \u63d0\u53d6\u5d4c\u5957\u5bf9\u8c61<br \/>\nSELECT JSON_QUERY(info, &#039;$.address&#039;) AS address<br \/>\nFROM json_test WHERE id &#061; 3;<br \/>\n&#8212; \u63d0\u53d6\u6570\u7ec4\u4e2d\u7279\u5b9a\u5143\u7d20<br \/>\nSELECT JSON_QUERY(info, &#039;$.hobbies[0]&#039;) AS first_hobby<br \/>\nFROM json_test WHERE id &#061; 3;<\/p>\n<h4>2.3 JSON_EXISTS\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_EXISTS\u51fd\u6570\u7528\u4e8e\u5224\u65adJSON\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u5b58\u5728\u6307\u5b9a\u8def\u5f84\u7684\u503c,\u8fd4\u56de\u5e03\u5c14\u503cTRUE\u6216FALSE\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_EXISTS(json_string, json_path)<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u5224\u65ad\u5c5e\u6027\u662f\u5426\u5b58\u5728<br \/>\nSELECT id, JSON_EXISTS(info, &#039;$.address&#039;) AS has_address<br \/>\nFROM json_test;<br \/>\n&#8212; \u5728WHERE\u6761\u4ef6\u4e2d\u4f7f\u7528<br \/>\nSELECT id, JSON_VALUE(info, &#039;$.name&#039;) AS name<br \/>\nFROM json_test<br \/>\nWHERE JSON_EXISTS(info, &#039;$.address.city&#039;);<br \/>\n&#8212; \u5224\u65ad\u6570\u7ec4\u662f\u5426\u5b58\u5728<br \/>\nSELECT id<br \/>\nFROM json_test<br \/>\nWHERE JSON_EXISTS(info, &#039;$.hobbies&#039;);<\/p>\n<h4>2.4 JSON_OBJECT\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_OBJECT\u51fd\u6570\u7528\u4e8e\u6784\u5efaJSON\u5bf9\u8c61,\u5c06\u952e\u503c\u5bf9\u8f6c\u6362\u4e3aJSON\u683c\u5f0f\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_OBJECT(key1 VALUE value1, key2 VALUE value2, &#8230;)<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u6784\u5efa\u7b80\u5355JSON\u5bf9\u8c61<br \/>\nSELECT JSON_OBJECT(&#039;name&#039; VALUE &#039;zhaoliu&#039;, &#039;age&#039; VALUE 35) AS json_obj;<br \/>\n&#8212; \u4ece\u8868\u6570\u636e\u6784\u5efaJSON<br \/>\nSELECT JSON_OBJECT(<br \/>\n    &#039;id&#039; VALUE id,<br \/>\n    &#039;name&#039; VALUE JSON_VALUE(info, &#039;$.name&#039;),<br \/>\n    &#039;age&#039; VALUE JSON_VALUE(info, &#039;$.age&#039;)<br \/>\n) AS json_obj<br \/>\nFROM json_test;<br \/>\n&#8212; \u5d4c\u5957JSON\u5bf9\u8c61<br \/>\nSELECT JSON_OBJECT(<br \/>\n    &#039;user&#039; VALUE JSON_OBJECT(<br \/>\n        &#039;name&#039; VALUE &#039;qianqi&#039;,<br \/>\n        &#039;age&#039; VALUE 40<br \/>\n    ),<br \/>\n    &#039;role&#039; VALUE &#039;admin&#039;<br \/>\n) AS nested_json;<\/p>\n<h4>2.5 JSON_ARRAY\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_ARRAY\u51fd\u6570\u7528\u4e8e\u6784\u5efaJSON\u6570\u7ec4,\u5c06\u591a\u4e2a\u503c\u7ec4\u5408\u6210JSON\u6570\u7ec4\u683c\u5f0f\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_ARRAY(value1, value2, &#8230;)<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u6784\u5efa\u7b80\u5355\u6570\u7ec4<br \/>\nSELECT JSON_ARRAY(&#039;apple&#039;, &#039;banana&#039;, &#039;cherry&#039;) AS fruits;<br \/>\n&#8212; \u6784\u5efa\u6570\u5b57\u6570\u7ec4<br \/>\nSELECT JSON_ARRAY(1, 2, 3, 4, 5) AS numbers;<br \/>\n&#8212; \u6784\u5efa\u6df7\u5408\u7c7b\u578b\u6570\u7ec4<br \/>\nSELECT JSON_ARRAY(&#039;test&#039;, 123, TRUE, NULL) AS mixed;<br \/>\n&#8212; \u805a\u5408\u6784\u5efa\u6570\u7ec4<br \/>\nSELECT JSON_ARRAYAGG(JSON_VALUE(info, &#039;$.name&#039;)) AS all_names<br \/>\nFROM json_test;<\/p>\n<h4>2.6 JSON_TABLE\u51fd\u6570\u4f7f\u7528<\/h4>\n<p>JSON_TABLE\u51fd\u6570\u662fDM8\u4e2d\u529f\u80fd\u6700\u5f3a\u5927\u7684JSON\u5904\u7406\u51fd\u6570,\u5b83\u53ef\u4ee5\u5c06JSON\u6570\u636e\u8f6c\u6362\u4e3a\u5173\u7cfb\u8868\u683c\u5f0f,\u4fbf\u4e8e\u8fdb\u884cSQL\u67e5\u8be2\u548c\u5206\u6790\u3002<\/p>\n<p>\u8bed\u6cd5\u683c\u5f0f:<\/p>\n<p>JSON_TABLE(json_string, json_path COLUMNS (<br \/>\n    column_name column_type PATH json_path,<br \/>\n    column_name column_type PATH json_path,<br \/>\n    &#8230;<br \/>\n))<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p>&#8212; \u521b\u5efa\u5305\u542bJSON\u6570\u7ec4\u7684\u6d4b\u8bd5\u6570\u636e<br \/>\nCREATE TABLE json_array_test (<br \/>\n    id INT,<br \/>\n    data CLOB<br \/>\n);<br \/>\nINSERT INTO json_array_test VALUES (1, &#039;{<br \/>\n    &#034;department&#034;: &#034;tech&#034;,<br \/>\n    &#034;employees&#034;: [<br \/>\n        {&#034;name&#034;: &#034;zhangsan&#034;, &#034;age&#034;: 30, &#034;position&#034;: &#034;engineer&#034;},<br \/>\n        {&#034;name&#034;: &#034;lisi&#034;, &#034;age&#034;: 25, &#034;position&#034;: &#034;tester&#034;},<br \/>\n        {&#034;name&#034;: &#034;wangwu&#034;, &#034;age&#034;: 28, &#034;position&#034;: &#034;pm&#034;}<br \/>\n    ]<br \/>\n}&#039;);<br \/>\n&#8212; \u4f7f\u7528JSON_TABLE\u5c55\u5f00\u6570\u7ec4<br \/>\nSELECT t.id,<br \/>\n       jt.name,<br \/>\n       jt.age,<br \/>\n       jt.position<br \/>\nFROM json_array_test t,<br \/>\nJSON_TABLE(t.data, &#039;$.employees[*]&#039; COLUMNS (<br \/>\n    name VARCHAR(50) PATH &#039;$.name&#039;,<br \/>\n    age INT PATH &#039;$.age&#039;,<br \/>\n    position VARCHAR(50) PATH &#039;$.position&#039;<br \/>\n)) jt;<\/p>\n<h3>\u4e09\u3001JSON\u51fd\u6570\u5b9e\u6218\u6848\u4f8b<\/h3>\n<h4>3.1 JSON\u6570\u636e\u67e5\u8be2\u4e0e\u63d0\u53d6<\/h4>\n<p>\u672c\u8282\u901a\u8fc7\u5b9e\u9645\u6848\u4f8b\u6f14\u793a\u5982\u4f55\u4f7f\u7528JSON\u51fd\u6570\u8fdb\u884c\u6570\u636e\u67e5\u8be2\u548c\u63d0\u53d6\u3002<\/p>\n<p>\u6848\u4f8b\u4e00:\u7535\u5546\u8ba2\u5355\u6570\u636e\u67e5\u8be2<\/p>\n<p>&#8212; \u521b\u5efa\u8ba2\u5355\u8868<br \/>\nCREATE TABLE orders (<br \/>\n    order_id INT PRIMARY KEY,<br \/>\n    customer_id INT,<br \/>\n    order_info CLOB,<br \/>\n    create_time TIMESTAMP<br \/>\n);<br \/>\n&#8212; \u63d2\u5165\u8ba2\u5355\u6570\u636e<br \/>\nINSERT INTO orders VALUES (1, 1001, &#039;{<br \/>\n    &#034;product&#034;: &#034;laptop&#034;,<br \/>\n    &#034;price&#034;: 5999,<br \/>\n    &#034;quantity&#034;: 1,<br \/>\n    &#034;attributes&#034;: {<br \/>\n        &#034;brand&#034;: &#034;lenovo&#034;,<br \/>\n        &#034;model&#034;: &#034;ThinkPad&#034;,<br \/>\n        &#034;color&#034;: &#034;black&#034;<br \/>\n    },<br \/>\n    &#034;tags&#034;: [&#034;electronics&#034;, &#034;office&#034;, &#034;premium&#034;]<br \/>\n}&#039;, SYSDATE);<br \/>\nINSERT INTO orders VALUES (2, 1002, &#039;{<br \/>\n    &#034;product&#034;: &#034;phone&#034;,<br \/>\n    &#034;price&#034;: 3999,<br \/>\n    &#034;quantity&#034;: 2,<br \/>\n    &#034;attributes&#034;: {<br \/>\n        &#034;brand&#034;: &#034;huawei&#034;,<br \/>\n        &#034;model&#034;: &#034;Mate60&#034;,<br \/>\n        &#034;color&#034;: &#034;white&#034;<br \/>\n    },<br \/>\n    &#034;tags&#034;: [&#034;electronics&#034;, &#034;mobile&#034;]<br \/>\n}&#039;, SYSDATE);<br \/>\n&#8212; \u67e5\u8be2\u8ba2\u5355\u57fa\u672c\u4fe1\u606f<br \/>\nSELECT order_id,<br \/>\n       customer_id,<br \/>\n       JSON_VALUE(order_info, &#039;$.product&#039;) AS product,<br \/>\n       JSON_VALUE(order_info, &#039;$.price&#039;) AS price,<br \/>\n       JSON_VALUE(order_info, &#039;$.quantity&#039;) AS quantity<br \/>\nFROM orders;<br \/>\n&#8212; \u67e5\u8be2\u8ba2\u5355\u5c5e\u6027<br \/>\nSELECT order_id,<br \/>\n       JSON_VALUE(order_info, &#039;$.attributes.brand&#039;) AS brand,<br \/>\n       JSON_VALUE(order_info, &#039;$.attributes.model&#039;) AS model,<br \/>\n       JSON_VALUE(order_info, &#039;$.attributes.color&#039;) AS color<br \/>\nFROM orders;<br \/>\n&#8212; \u8ba1\u7b97\u8ba2\u5355\u603b\u4ef7<br \/>\nSELECT order_id,<br \/>\n       JSON_VALUE(order_info, &#039;$.product&#039;) AS product,<br \/>\n       CAST(JSON_VALUE(order_info, &#039;$.price&#039;) AS DECIMAL(10,2)) *<br \/>\n       CAST(JSON_VALUE(order_info, &#039;$.quantity&#039;) AS INT) AS total_price<br \/>\nFROM orders;<br \/>\n&#8212; \u67e5\u8be2\u5305\u542b\u7279\u5b9a\u6807\u7b7e\u7684\u8ba2\u5355<br \/>\nSELECT order_id, JSON_QUERY(order_info, &#039;$.tags&#039;) AS tags<br \/>\nFROM orders<br \/>\nWHERE JSON_EXISTS(order_info, &#039;$.tags&#039;);<\/p>\n<p>\u6848\u4f8b\u4e8c:\u65e5\u5fd7\u6570\u636e\u5206\u6790<\/p>\n<p>&#8212; \u521b\u5efa\u65e5\u5fd7\u8868<br \/>\nCREATE TABLE app_logs (<br \/>\n    log_id INT PRIMARY KEY,<br \/>\n    log_time TIMESTAMP,<br \/>\n    log_data CLOB<br \/>\n);<br \/>\n&#8212; \u63d2\u5165\u65e5\u5fd7\u6570\u636e<br \/>\nINSERT INTO app_logs VALUES (1, SYSDATE, &#039;{<br \/>\n    &#034;level&#034;: &#034;ERROR&#034;,<br \/>\n    &#034;module&#034;: &#034;auth&#034;,<br \/>\n    &#034;message&#034;: &#034;login failed&#034;,<br \/>\n    &#034;details&#034;: {<br \/>\n        &#034;user&#034;: &#034;admin&#034;,<br \/>\n        &#034;ip&#034;: &#034;192.168.1.100&#034;,<br \/>\n        &#034;attempt&#034;: 3<br \/>\n    }<br \/>\n}&#039;);<br \/>\nINSERT INTO app_logs VALUES (2, SYSDATE, &#039;{<br \/>\n    &#034;level&#034;: &#034;INFO&#034;,<br \/>\n    &#034;module&#034;: &#034;order&#034;,<br \/>\n    &#034;message&#034;: &#034;order created&#034;,<br \/>\n    &#034;details&#034;: {<br \/>\n        &#034;order_id&#034;: &#034;ORD20240101001&#034;,<br \/>\n        &#034;amount&#034;: 999<br \/>\n    }<br \/>\n}&#039;);<br \/>\n&#8212; \u6309\u65e5\u5fd7\u7ea7\u522b\u7edf\u8ba1<br \/>\nSELECT JSON_VALUE(log_data, &#039;$.level&#039;) AS log_level,<br \/>\n       COUNT(*) AS count<br \/>\nFROM app_logs<br \/>\nGROUP BY JSON_VALUE(log_data, &#039;$.level&#039;);<br \/>\n&#8212; \u67e5\u8be2\u9519\u8bef\u65e5\u5fd7<br \/>\nSELECT log_id,<br \/>\n       log_time,<br \/>\n       JSON_VALUE(log_data, &#039;$.module&#039;) AS module,<br \/>\n       JSON_VALUE(log_data, &#039;$.message&#039;) AS message,<br \/>\n       JSON_QUERY(log_data, &#039;$.details&#039;) AS details<br \/>\nFROM app_logs<br \/>\nWHERE JSON_VALUE(log_data, &#039;$.level&#039;) &#061; &#039;ERROR&#039;;<\/p>\n<h4>3.2 JSON\u6570\u636e\u6784\u5efa\u4e0e\u4fee\u6539<\/h4>\n<p>\u672c\u8282\u6f14\u793a\u5982\u4f55\u4f7f\u7528JSON\u51fd\u6570\u6784\u5efa\u548c\u4fee\u6539JSON\u6570\u636e\u3002<\/p>\n<p>\u6848\u4f8b\u4e00:\u52a8\u6001\u6784\u5efaJSON\u914d\u7f6e<\/p>\n<p>&#8212; \u521b\u5efa\u914d\u7f6e\u8868<br \/>\nCREATE TABLE app_config (<br \/>\n    config_id INT PRIMARY KEY,<br \/>\n    config_name VARCHAR(100),<br \/>\n    config_data CLOB,<br \/>\n    update_time TIMESTAMP<br \/>\n);<br \/>\n&#8212; \u4f7f\u7528JSON_OBJECT\u6784\u5efa\u914d\u7f6e<br \/>\nINSERT INTO app_config VALUES (<br \/>\n    1,<br \/>\n    &#039;database_config&#039;,<br \/>\n    JSON_OBJECT(<br \/>\n        &#039;host&#039; VALUE &#039;localhost&#039;,<br \/>\n        &#039;port&#039; VALUE 5236,<br \/>\n        &#039;database&#039; VALUE &#039;DM8&#039;,<br \/>\n        &#039;username&#039; VALUE &#039;SYSDBA&#039;,<br \/>\n        &#039;pool_size&#039; VALUE 10,<br \/>\n        &#039;timeout&#039; VALUE 30,<br \/>\n        &#039;ssl&#039; VALUE FALSE<br \/>\n    ),<br \/>\n    SYSDATE<br \/>\n);<br \/>\n&#8212; \u6784\u5efa\u5d4c\u5957\u914d\u7f6e<br \/>\nINSERT INTO app_config VALUES (<br \/>\n    2,<br \/>\n    &#039;app_config&#039;,<br \/>\n    JSON_OBJECT(<br \/>\n        &#039;app&#039; VALUE JSON_OBJECT(<br \/>\n            &#039;name&#039; VALUE &#039;MyApp&#039;,<br \/>\n            &#039;version&#039; VALUE &#039;1.0.0&#039;<br \/>\n        ),<br \/>\n        &#039;features&#039; VALUE JSON_ARRAY(<br \/>\n            &#039;authentication&#039;,<br \/>\n            &#039;logging&#039;,<br \/>\n            &#039;monitoring&#039;<br \/>\n        ),<br \/>\n        &#039;limits&#039; VALUE JSON_OBJECT(<br \/>\n            &#039;max_users&#039; VALUE 1000,<br \/>\n            &#039;max_requests&#039; VALUE 10000<br \/>\n        )<br \/>\n    ),<br \/>\n    SYSDATE<br \/>\n);<br \/>\n&#8212; \u4ece\u5173\u7cfb\u6570\u636e\u6784\u5efaJSON<br \/>\nCREATE TABLE users (<br \/>\n    user_id INT PRIMARY KEY,<br \/>\n    username VARCHAR(50),<br \/>\n    email VARCHAR(100),<br \/>\n    phone VARCHAR(20)<br \/>\n);<br \/>\nINSERT INTO users VALUES (1, &#039;zhangsan&#039;, &#039;zhangsan&#064;example.com&#039;, &#039;13800138000&#039;);<br \/>\nINSERT INTO users VALUES (2, &#039;lisi&#039;, &#039;lisi&#064;example.com&#039;, &#039;13900139000&#039;);<br \/>\n&#8212; \u5c06\u7528\u6237\u6570\u636e\u8f6c\u4e3aJSON\u683c\u5f0f<br \/>\nSELECT JSON_OBJECT(<br \/>\n    &#039;user_id&#039; VALUE user_id,<br \/>\n    &#039;username&#039; VALUE username,<br \/>\n    &#039;contact&#039; VALUE JSON_OBJECT(<br \/>\n        &#039;email&#039; VALUE email,<br \/>\n        &#039;phone&#039; VALUE phone<br \/>\n    )<br \/>\n) AS user_json<br \/>\nFROM users;<\/p>\n<p>\u6848\u4f8b\u4e8c:JSON\u6570\u636e\u66f4\u65b0<\/p>\n<p>&#8212; \u521b\u5efa\u7528\u6237\u6269\u5c55\u4fe1\u606f\u8868<br \/>\nCREATE TABLE user_profile (<br \/>\n    user_id INT PRIMARY KEY,<br \/>\n    profile CLOB<br \/>\n);<br \/>\nINSERT INTO user_profile VALUES (1, &#039;{&#034;nickname&#034;: &#034;zs&#034;, &#034;bio&#034;: &#034;developer&#034;, &#034;skills&#034;: [&#034;Java&#034;, &#034;Python&#034;]}&#039;);<br \/>\n&#8212; \u66f4\u65b0JSON\u4e2d\u7684\u7279\u5b9a\u5b57\u6bb5<br \/>\nUPDATE user_profile<br \/>\nSET profile &#061; JSON_OBJECT(<br \/>\n    &#039;nickname&#039; VALUE &#039;zsf&#039;,<br \/>\n    &#039;bio&#039; VALUE JSON_VALUE(profile, &#039;$.bio&#039;),<br \/>\n    &#039;skills&#039; VALUE JSON_QUERY(profile, &#039;$.skills&#039;)<br \/>\n)<br \/>\nWHERE user_id &#061; 1;<br \/>\n&#8212; \u6dfb\u52a0\u65b0\u5b57\u6bb5<br \/>\nUPDATE user_profile<br \/>\nSET profile &#061; JSON_OBJECT(<br \/>\n    &#039;nickname&#039; VALUE JSON_VALUE(profile, &#039;$.nickname&#039;),<br \/>\n    &#039;bio&#039; VALUE JSON_VALUE(profile, &#039;$.bio&#039;),<br \/>\n    &#039;skills&#039; VALUE JSON_QUERY(profile, &#039;$.skills&#039;),<br \/>\n    &#039;avatar&#039; VALUE &#039;\/images\/avatar1.png&#039;,<br \/>\n    &#039;level&#039; VALUE 5<br \/>\n)<br \/>\nWHERE user_id &#061; 1;<\/p>\n<h4>3.3 JSON\u4e0e\u5173\u7cfb\u6570\u636e\u8f6c\u6362<\/h4>\n<p>\u672c\u8282\u6f14\u793aJSON\u6570\u636e\u4e0e\u5173\u7cfb\u6570\u636e\u4e4b\u95f4\u7684\u76f8\u4e92\u8f6c\u6362\u3002<\/p>\n<p>\u6848\u4f8b\u4e00:JSON\u6570\u7ec4\u5c55\u5f00\u4e3a\u5173\u7cfb\u8868<\/p>\n<p>&#8212; \u521b\u5efa\u5305\u542bJSON\u6570\u7ec4\u7684\u5546\u54c1\u8868<br \/>\nCREATE TABLE products (<br \/>\n    product_id INT PRIMARY KEY,<br \/>\n    product_name VARCHAR(100),<br \/>\n    variants CLOB<br \/>\n);<br \/>\nINSERT INTO products VALUES (1, &#039;T-Shirt&#039;, &#039;[<br \/>\n    {&#034;size&#034;: &#034;S&#034;, &#034;color&#034;: &#034;white&#034;, &#034;price&#034;: 99, &#034;stock&#034;: 100},<br \/>\n    {&#034;size&#034;: &#034;M&#034;, &#034;color&#034;: &#034;white&#034;, &#034;price&#034;: 99, &#034;stock&#034;: 150},<br \/>\n    {&#034;size&#034;: &#034;L&#034;, &#034;color&#034;: &#034;black&#034;, &#034;price&#034;: 109, &#034;stock&#034;: 80},<br \/>\n    {&#034;size&#034;: &#034;XL&#034;, &#034;color&#034;: &#034;black&#034;, &#034;price&#034;: 119, &#034;stock&#034;: 50}<br \/>\n]&#039;);<br \/>\n&#8212; \u4f7f\u7528JSON_TABLE\u5c55\u5f00\u53d8\u4f53\u4fe1\u606f<br \/>\nSELECT p.product_id,<br \/>\n       p.product_name,<br \/>\n       v.size,<br \/>\n       v.color,<br \/>\n       v.price,<br \/>\n       v.stock<br \/>\nFROM products p,<br \/>\nJSON_TABLE(p.variants, &#039;$[*]&#039; COLUMNS (<br \/>\n    size VARCHAR(10) PATH &#039;$.size&#039;,<br \/>\n    color VARCHAR(20) PATH &#039;$.color&#039;,<br \/>\n    price DECIMAL(10,2) PATH &#039;$.price&#039;,<br \/>\n    stock INT PATH &#039;$.stock&#039;<br \/>\n)) v;<br \/>\n&#8212; \u6761\u4ef6\u8fc7\u6ee4<br \/>\nSELECT p.product_name,<br \/>\n       v.size,<br \/>\n       v.color,<br \/>\n       v.price<br \/>\nFROM products p,<br \/>\nJSON_TABLE(p.variants, &#039;$[*]&#039; COLUMNS (<br \/>\n    size VARCHAR(10) PATH &#039;$.size&#039;,<br \/>\n    color VARCHAR(20) PATH &#039;$.color&#039;,<br \/>\n    price DECIMAL(10,2) PATH &#039;$.price&#039;,<br \/>\n    stock INT PATH &#039;$.stock&#039;<br \/>\n)) v<br \/>\nWHERE v.stock &gt; 100 AND v.price &lt; 100;<\/p>\n<p>\u6848\u4f8b\u4e8c:\u5173\u7cfb\u6570\u636e\u805a\u5408\u4e3aJSON<\/p>\n<p>&#8212; \u521b\u5efa\u90e8\u95e8\u5458\u5de5\u8868<br \/>\nCREATE TABLE dept_employee (<br \/>\n    dept_id INT,<br \/>\n    dept_name VARCHAR(50),<br \/>\n    emp_id INT,<br \/>\n    emp_name VARCHAR(50),<br \/>\n    salary DECIMAL(10,2)<br \/>\n);<br \/>\nINSERT INTO dept_employee VALUES (1, &#039;tech&#039;, 101, &#039;zhangsan&#039;, 15000);<br \/>\nINSERT INTO dept_employee VALUES (1, &#039;tech&#039;, 102, &#039;lisi&#039;, 12000);<br \/>\nINSERT INTO dept_employee VALUES (1, &#039;tech&#039;, 103, &#039;wangwu&#039;, 18000);<br \/>\nINSERT INTO dept_employee VALUES (2, &#039;market&#039;, 201, &#039;zhaoliu&#039;, 10000);<br \/>\nINSERT INTO dept_employee VALUES (2, &#039;market&#039;, 202, &#039;qianqi&#039;, 11000);<br \/>\n&#8212; \u6309\u90e8\u95e8\u805a\u5408\u5458\u5de5\u4fe1\u606f\u4e3aJSON<br \/>\nSELECT dept_id,<br \/>\n       dept_name,<br \/>\n       JSON_OBJECT(<br \/>\n           &#039;dept_id&#039; VALUE dept_id,<br \/>\n           &#039;dept_name&#039; VALUE dept_name,<br \/>\n           &#039;employees&#039; VALUE JSON_ARRAYAGG(<br \/>\n               JSON_OBJECT(<br \/>\n                   &#039;emp_id&#039; VALUE emp_id,<br \/>\n                   &#039;emp_name&#039; VALUE emp_name,<br \/>\n                   &#039;salary&#039; VALUE salary<br \/>\n               )<br \/>\n           )<br \/>\n       ) AS dept_json<br \/>\nFROM dept_employee<br \/>\nGROUP BY dept_id, dept_name;<\/p>\n<h3>\u56db\u3001JSON\u51fd\u6570\u6027\u80fd\u4f18\u5316\u5efa\u8bae<\/h3>\n<h4>4.1 \u7d22\u5f15\u7b56\u7565\u4f18\u5316<\/h4>\n<p>\u5bf9\u4e8e\u9891\u7e41\u67e5\u8be2\u7684JSON\u5b57\u6bb5,\u5efa\u8bae\u5efa\u7acb\u51fd\u6570\u7d22\u5f15\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002<\/p>\n<p>&#8212; \u4e3aJSON\u5b57\u6bb5\u521b\u5efa\u51fd\u6570\u7d22\u5f15<br \/>\nCREATE INDEX idx_json_name ON json_test(JSON_VALUE(info, &#039;$.name&#039;));<br \/>\nCREATE INDEX idx_json_age ON json_test(CAST(JSON_VALUE(info, &#039;$.age&#039;) AS INT));<br \/>\n&#8212; \u590d\u5408\u51fd\u6570\u7d22\u5f15<br \/>\nCREATE INDEX idx_json_name_age ON json_test(<br \/>\n    JSON_VALUE(info, &#039;$.name&#039;),<br \/>\n    CAST(JSON_VALUE(info, &#039;$.age&#039;) AS INT)<br \/>\n);<br \/>\n&#8212; \u9a8c\u8bc1\u7d22\u5f15\u4f7f\u7528<br \/>\nEXPLAIN SELECT * FROM json_test<br \/>\nWHERE JSON_VALUE(info, &#039;$.name&#039;) &#061; &#039;zhangsan&#039;;<\/p>\n<p>\u7d22\u5f15\u4f18\u5316\u6d41\u7a0b:<\/p>\n<p>#publish-mermaid-1786238292356-3{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238292356-3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292356-3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292356-3 .error-icon{fill:#552222;}#publish-mermaid-1786238292356-3 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238292356-3 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238292356-3 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238292356-3 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238292356-3 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238292356-3 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238292356-3 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238292356-3 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238292356-3 .marker.cross{stroke:#333333;}#publish-mermaid-1786238292356-3 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238292356-3 p{margin:0;}#publish-mermaid-1786238292356-3 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238292356-3 .cluster-label text{fill:#333;}#publish-mermaid-1786238292356-3 .cluster-label span{color:#333;}#publish-mermaid-1786238292356-3 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238292356-3 .label text,#publish-mermaid-1786238292356-3 span{fill:#333;color:#333;}#publish-mermaid-1786238292356-3 .node rect,#publish-mermaid-1786238292356-3 .node circle,#publish-mermaid-1786238292356-3 .node ellipse,#publish-mermaid-1786238292356-3 .node polygon,#publish-mermaid-1786238292356-3 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292356-3 .rough-node .label text,#publish-mermaid-1786238292356-3 .node .label text,#publish-mermaid-1786238292356-3 .image-shape .label,#publish-mermaid-1786238292356-3 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238292356-3 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238292356-3 .rough-node .label,#publish-mermaid-1786238292356-3 .node .label,#publish-mermaid-1786238292356-3 .image-shape .label,#publish-mermaid-1786238292356-3 .icon-shape .label{text-align:center;}#publish-mermaid-1786238292356-3 .node.clickable{cursor:pointer;}#publish-mermaid-1786238292356-3 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238292356-3 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238292356-3 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238292356-3 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238292356-3 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292356-3 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292356-3 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292356-3 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238292356-3 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238292356-3 .cluster text{fill:#333;}#publish-mermaid-1786238292356-3 .cluster span{color:#333;}#publish-mermaid-1786238292356-3 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238292356-3 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238292356-3 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238292356-3 .icon-shape,#publish-mermaid-1786238292356-3 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292356-3 .icon-shape p,#publish-mermaid-1786238292356-3 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238292356-3 .icon-shape .label rect,#publish-mermaid-1786238292356-3 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292356-3 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238292356-3 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238292356-3 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292356-3 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292356-3 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u9ad8\u9891\u67e5\u8be2\u4f4e\u9891\u67e5\u8be2\u662f\u5426<span class=\"nodeLabel\"><\/p>\n<p>JSON\u67e5\u8be2\u9700\u6c42<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u9891\u7387<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u521b\u5efa\u51fd\u6570\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5168\u8868\u626b\u63cf<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5206\u6790\u67e5\u8be2\u6761\u4ef6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5355\u5b57\u6bb5\u67e5\u8be2<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u591a\u5b57\u6bb5\u67e5\u8be2<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5355\u5b57\u6bb5\u51fd\u6570\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u590d\u5408\u51fd\u6570\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u9a8c\u8bc1\u6267\u884c\u8ba1\u5212<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u662f\u5426\u8d70\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f18\u5316\u5b8c\u6210<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8c03\u6574\u7d22\u5f15\u7b56\u7565<\/p>\n<p><\/span><\/p>\n<h4>4.2 \u67e5\u8be2\u4f18\u5316\u6280\u5de7<\/h4>\n<li>\u907f\u514d\u91cd\u590d\u89e3\u6790:\u5bf9\u540c\u4e00JSON\u5b57\u6bb5\u591a\u6b21\u8c03\u7528JSON_VALUE\u65f6,\u8003\u8651\u4f7f\u7528\u5b50\u67e5\u8be2\u6216CTE<\/li>\n<li>\u5408\u7406\u4f7f\u7528CAST:JSON_VALUE\u8fd4\u56de\u5b57\u7b26\u4e32,\u9700\u8981\u65f6\u53ca\u65f6\u8f6c\u6362\u4e3a\u5408\u9002\u7c7b\u578b<\/li>\n<li>\u9650\u5236\u8fd4\u56de\u6570\u636e:\u4f7f\u7528JSON_QUERY\u63d0\u53d6\u7247\u6bb5\u800c\u975e\u6574\u4e2aJSON<\/li>\n<li>\u5584\u7528JSON_TABLE:\u5904\u7406\u6570\u7ec4\u6570\u636e\u65f6,JSON_TABLE\u6bd4\u591a\u6b21JSON_VALUE\u66f4\u9ad8\u6548<\/li>\n<p>&#8212; \u4f18\u5316\u524d:\u91cd\u590d\u89e3\u6790JSON<br \/>\nSELECT JSON_VALUE(info, &#039;$.name&#039;) AS name,<br \/>\n       JSON_VALUE(info, &#039;$.age&#039;) AS age,<br \/>\n       JSON_VALUE(info, &#039;$.city&#039;) AS city,<br \/>\n       JSON_VALUE(info, &#039;$.name&#039;) || &#039;&#064;example.com&#039; AS email<br \/>\nFROM json_test;<br \/>\n&#8212; \u4f18\u5316\u540e:\u4f7f\u7528CTE\u51cf\u5c11\u91cd\u590d\u89e3\u6790<br \/>\nWITH parsed_json AS (<br \/>\n    SELECT id,<br \/>\n           JSON_VALUE(info, &#039;$.name&#039;) AS name,<br \/>\n           JSON_VALUE(info, &#039;$.age&#039;) AS age,<br \/>\n           JSON_VALUE(info, &#039;$.city&#039;) AS city<br \/>\n    FROM json_test<br \/>\n)<br \/>\nSELECT name, age, city, name || &#039;&#064;example.com&#039; AS email<br \/>\nFROM parsed_json;<br \/>\n&#8212; \u4f7f\u7528JSON_TABLE\u4e00\u6b21\u6027\u63d0\u53d6\u591a\u4e2a\u5b57\u6bb5<br \/>\nSELECT jt.name, jt.age, jt.city<br \/>\nFROM json_test t,<br \/>\nJSON_TABLE(t.info, &#039;$&#039; COLUMNS (<br \/>\n    name VARCHAR(50) PATH &#039;$.name&#039;,<br \/>\n    age INT PATH &#039;$.age&#039;,<br \/>\n    city VARCHAR(50) PATH &#039;$.city&#039;<br \/>\n)) jt;<\/p>\n<p>\u67e5\u8be2\u4f18\u5316\u51b3\u7b56\u6d41\u7a0b:<\/p>\n<p>#publish-mermaid-1786238292489-4{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238292489-4 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292489-4 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292489-4 .error-icon{fill:#552222;}#publish-mermaid-1786238292489-4 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238292489-4 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238292489-4 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238292489-4 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238292489-4 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238292489-4 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238292489-4 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238292489-4 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238292489-4 .marker.cross{stroke:#333333;}#publish-mermaid-1786238292489-4 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238292489-4 p{margin:0;}#publish-mermaid-1786238292489-4 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238292489-4 .cluster-label text{fill:#333;}#publish-mermaid-1786238292489-4 .cluster-label span{color:#333;}#publish-mermaid-1786238292489-4 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238292489-4 .label text,#publish-mermaid-1786238292489-4 span{fill:#333;color:#333;}#publish-mermaid-1786238292489-4 .node rect,#publish-mermaid-1786238292489-4 .node circle,#publish-mermaid-1786238292489-4 .node ellipse,#publish-mermaid-1786238292489-4 .node polygon,#publish-mermaid-1786238292489-4 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292489-4 .rough-node .label text,#publish-mermaid-1786238292489-4 .node .label text,#publish-mermaid-1786238292489-4 .image-shape .label,#publish-mermaid-1786238292489-4 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238292489-4 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238292489-4 .rough-node .label,#publish-mermaid-1786238292489-4 .node .label,#publish-mermaid-1786238292489-4 .image-shape .label,#publish-mermaid-1786238292489-4 .icon-shape .label{text-align:center;}#publish-mermaid-1786238292489-4 .node.clickable{cursor:pointer;}#publish-mermaid-1786238292489-4 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238292489-4 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238292489-4 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238292489-4 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238292489-4 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292489-4 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292489-4 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292489-4 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238292489-4 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238292489-4 .cluster text{fill:#333;}#publish-mermaid-1786238292489-4 .cluster span{color:#333;}#publish-mermaid-1786238292489-4 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238292489-4 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238292489-4 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238292489-4 .icon-shape,#publish-mermaid-1786238292489-4 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292489-4 .icon-shape p,#publish-mermaid-1786238292489-4 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238292489-4 .icon-shape .label rect,#publish-mermaid-1786238292489-4 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292489-4 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238292489-4 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238292489-4 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292489-4 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292489-4 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u5355\u503c\u63d0\u53d6\u7247\u6bb5\u63d0\u53d6\u6570\u7ec4\u5c55\u5f00\u6761\u4ef6\u5224\u65ad\u662f\u5426\u662f\u5426<span class=\"nodeLabel\"><\/p>\n<p>JSON\u67e5\u8be2<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u7c7b\u578b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_VALUE<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_QUERY<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_TABLE<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_EXISTS<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u591a\u6b21\u63d0\u53d6\u540c\u4e00JSON<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f7f\u7528CTE\/\u5b50\u67e5\u8be2<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u9700\u8981\u7c7b\u578b\u8f6c\u6362<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5728COLUMNS\u4e2d\u6307\u5b9a\u7c7b\u578b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f7f\u7528\u9ed8\u8ba4VARCHAR<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f18\u5316\u5b8c\u6210<\/p>\n<p><\/span><\/p>\n<h4>4.3 \u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>\u95ee\u9898\u4e00:JSON_VALUE\u8fd4\u56deNULL<\/p>\n<p>&#8212; \u539f\u56e0:\u8def\u5f84\u4e0d\u5b58\u5728\u6216\u503c\u4e0d\u662f\u6807\u91cf<br \/>\n&#8212; \u89e3\u51b3\u65b9\u6848:\u4f7f\u7528JSON_EXISTS\u5148\u5224\u65ad,\u6216\u4f7f\u7528\u9ed8\u8ba4\u503c<br \/>\nSELECT id,<br \/>\n       COALESCE(JSON_VALUE(info, &#039;$.phone&#039;), &#039;N\/A&#039;) AS phone<br \/>\nFROM json_test;<\/p>\n<p>\u95ee\u9898\u4e8c:\u6570\u5b57\u6bd4\u8f83\u4e0d\u6b63\u786e<\/p>\n<p>&#8212; \u539f\u56e0:JSON_VALUE\u8fd4\u56de\u5b57\u7b26\u4e32,\u9700\u8981CAST\u8f6c\u6362<br \/>\n&#8212; \u9519\u8bef\u5199\u6cd5:<br \/>\nSELECT * FROM json_test WHERE JSON_VALUE(info, &#039;$.age&#039;) &gt; 25;<br \/>\n&#8212; \u6b63\u786e\u5199\u6cd5:<br \/>\nSELECT * FROM json_test<br \/>\nWHERE CAST(JSON_VALUE(info, &#039;$.age&#039;) AS INT) &gt; 25;<\/p>\n<p>\u95ee\u9898\u4e09:JSON\u683c\u5f0f\u6821\u9a8c<\/p>\n<p>&#8212; \u4f7f\u7528IS JSON\u6761\u4ef6\u6821\u9a8c<br \/>\nSELECT id,<br \/>\n       CASE WHEN info IS JSON THEN &#039;valid&#039; ELSE &#039;invalid&#039; END AS json_valid<br \/>\nFROM json_test;<br \/>\n&#8212; \u8fc7\u6ee4\u6709\u6548JSON\u6570\u636e<br \/>\nSELECT * FROM json_test WHERE info IS JSON;<\/p>\n<p>\u95ee\u9898\u6392\u67e5\u6d41\u7a0b:<\/p>\n<p>#publish-mermaid-1786238292846-5{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238292846-5 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292846-5 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292846-5 .error-icon{fill:#552222;}#publish-mermaid-1786238292846-5 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238292846-5 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238292846-5 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238292846-5 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238292846-5 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238292846-5 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238292846-5 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238292846-5 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238292846-5 .marker.cross{stroke:#333333;}#publish-mermaid-1786238292846-5 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238292846-5 p{margin:0;}#publish-mermaid-1786238292846-5 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238292846-5 .cluster-label text{fill:#333;}#publish-mermaid-1786238292846-5 .cluster-label span{color:#333;}#publish-mermaid-1786238292846-5 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238292846-5 .label text,#publish-mermaid-1786238292846-5 span{fill:#333;color:#333;}#publish-mermaid-1786238292846-5 .node rect,#publish-mermaid-1786238292846-5 .node circle,#publish-mermaid-1786238292846-5 .node ellipse,#publish-mermaid-1786238292846-5 .node polygon,#publish-mermaid-1786238292846-5 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292846-5 .rough-node .label text,#publish-mermaid-1786238292846-5 .node .label text,#publish-mermaid-1786238292846-5 .image-shape .label,#publish-mermaid-1786238292846-5 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238292846-5 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238292846-5 .rough-node .label,#publish-mermaid-1786238292846-5 .node .label,#publish-mermaid-1786238292846-5 .image-shape .label,#publish-mermaid-1786238292846-5 .icon-shape .label{text-align:center;}#publish-mermaid-1786238292846-5 .node.clickable{cursor:pointer;}#publish-mermaid-1786238292846-5 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238292846-5 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238292846-5 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238292846-5 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238292846-5 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292846-5 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292846-5 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292846-5 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238292846-5 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238292846-5 .cluster text{fill:#333;}#publish-mermaid-1786238292846-5 .cluster span{color:#333;}#publish-mermaid-1786238292846-5 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238292846-5 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238292846-5 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238292846-5 .icon-shape,#publish-mermaid-1786238292846-5 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292846-5 .icon-shape p,#publish-mermaid-1786238292846-5 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238292846-5 .icon-shape .label rect,#publish-mermaid-1786238292846-5 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292846-5 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238292846-5 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238292846-5 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292846-5 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292846-5 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u8fd4\u56deNULL\u7c7b\u578b\u9519\u8bef\u8bed\u6cd5\u9519\u8bef\u6027\u80fd\u95ee\u9898<span class=\"nodeLabel\"><\/p>\n<p>JSON\u51fd\u6570\u5f02\u5e38<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5f02\u5e38\u7c7b\u578b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u68c0\u67e5\u8def\u5f84\u662f\u5426\u5b58\u5728<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u68c0\u67e5\u662f\u5426\u9700\u8981CAST<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u68c0\u67e5JSON\u683c\u5f0f<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u68c0\u67e5\u7d22\u5f15\u4f7f\u7528<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f7f\u7528JSON_EXISTS\u5224\u65ad<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6dfb\u52a0CAST\u8f6c\u6362<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4f7f\u7528IS JSON\u6821\u9a8c<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u521b\u5efa\u51fd\u6570\u7d22\u5f15<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u95ee\u9898\u89e3\u51b3<\/p>\n<p><\/span><\/p>\n<h3>\u4e94\u3001\u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<h4>5.1 \u4f7f\u7528\u573a\u666f\u603b\u7ed3<\/h4>\n<p>#publish-mermaid-1786238292972-6{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238292972-6 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292972-6 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238292972-6 .error-icon{fill:#552222;}#publish-mermaid-1786238292972-6 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238292972-6 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238292972-6 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238292972-6 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238292972-6 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238292972-6 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238292972-6 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238292972-6 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238292972-6 .marker.cross{stroke:#333333;}#publish-mermaid-1786238292972-6 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238292972-6 p{margin:0;}#publish-mermaid-1786238292972-6 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238292972-6 .cluster-label text{fill:#333;}#publish-mermaid-1786238292972-6 .cluster-label span{color:#333;}#publish-mermaid-1786238292972-6 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238292972-6 .label text,#publish-mermaid-1786238292972-6 span{fill:#333;color:#333;}#publish-mermaid-1786238292972-6 .node rect,#publish-mermaid-1786238292972-6 .node circle,#publish-mermaid-1786238292972-6 .node ellipse,#publish-mermaid-1786238292972-6 .node polygon,#publish-mermaid-1786238292972-6 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292972-6 .rough-node .label text,#publish-mermaid-1786238292972-6 .node .label text,#publish-mermaid-1786238292972-6 .image-shape .label,#publish-mermaid-1786238292972-6 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238292972-6 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238292972-6 .rough-node .label,#publish-mermaid-1786238292972-6 .node .label,#publish-mermaid-1786238292972-6 .image-shape .label,#publish-mermaid-1786238292972-6 .icon-shape .label{text-align:center;}#publish-mermaid-1786238292972-6 .node.clickable{cursor:pointer;}#publish-mermaid-1786238292972-6 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238292972-6 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238292972-6 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238292972-6 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238292972-6 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292972-6 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292972-6 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292972-6 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238292972-6 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238292972-6 .cluster text{fill:#333;}#publish-mermaid-1786238292972-6 .cluster span{color:#333;}#publish-mermaid-1786238292972-6 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238292972-6 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238292972-6 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238292972-6 .icon-shape,#publish-mermaid-1786238292972-6 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238292972-6 .icon-shape p,#publish-mermaid-1786238292972-6 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238292972-6 .icon-shape .label rect,#publish-mermaid-1786238292972-6 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238292972-6 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238292972-6 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238292972-6 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292972-6 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238292972-6 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"nodeLabel\"><\/p>\n<p>DM8 JSON\u51fd\u6570\u5e94\u7528<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u67e5\u8be2\u63d0\u53d6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6570\u636e\u6784\u5efa<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6570\u636e\u8f6c\u6362<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6027\u80fd\u4f18\u5316<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_VALUE: \u6807\u91cf\u503c\u63d0\u53d6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_QUERY: \u5bf9\u8c61\/\u6570\u7ec4\u63d0\u53d6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_EXISTS: \u8def\u5f84\u5b58\u5728\u5224\u65ad<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_OBJECT: \u5bf9\u8c61\u6784\u5efa<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_ARRAY: \u6570\u7ec4\u6784\u5efa<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_ARRAYAGG: \u805a\u5408\u4e3a\u6570\u7ec4<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_TABLE: JSON\u8f6c\u5173\u7cfb\u8868<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5173\u7cfb\u6570\u636e\u8f6cJSON\u5bf9\u8c61<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u51fd\u6570\u7d22\u5f15\u4f18\u5316<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>CTE\u51cf\u5c11\u91cd\u590d\u89e3\u6790<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u7c7b\u578b\u8f6c\u6362\u4f18\u5316<\/p>\n<p><\/span><\/p>\n<h4>5.2 \u6700\u4f73\u5b9e\u8df5\u5efa\u8bae<\/h4>\n<li>\u5408\u7406\u8bbe\u8ba1JSON\u7ed3\u6784:\u907f\u514d\u8fc7\u6df1\u7684\u5d4c\u5957,\u4fdd\u6301\u7ed3\u6784\u6e05\u6670<\/li>\n<li>\u89c4\u8303\u547d\u540d:JSON\u952e\u540d\u4f7f\u7528\u7edf\u4e00\u547d\u540d\u89c4\u8303(\u5982\u5c0f\u5199\u52a0\u4e0b\u5212\u7ebf)<\/li>\n<li>\u7d22\u5f15\u4f18\u5316:\u5bf9\u9ad8\u9891\u67e5\u8be2\u5b57\u6bb5\u5efa\u7acb\u51fd\u6570\u7d22\u5f15<\/li>\n<li>\u7c7b\u578b\u5b89\u5168:\u4f7f\u7528CAST\u786e\u4fdd\u7c7b\u578b\u6b63\u786e,\u907f\u514d\u9690\u5f0f\u8f6c\u6362\u95ee\u9898<\/li>\n<li>\u9519\u8bef\u5904\u7406:\u4f7f\u7528COALESCE\u6216NULLIF\u5904\u7406\u53ef\u80fd\u7684NULL\u503c<\/li>\n<li>\u6027\u80fd\u76d1\u63a7:\u5b9a\u671f\u68c0\u67e5JSON\u67e5\u8be2\u7684\u6267\u884c\u8ba1\u5212<\/li>\n<h4>5.3 \u6ce8\u610f\u4e8b\u9879\u8bf4\u660e<\/h4>\n<li>JSON_VALUE\u53ea\u80fd\u8fd4\u56de\u6807\u91cf\u503c,\u63d0\u53d6\u5bf9\u8c61\u6216\u6570\u7ec4\u8bf7\u4f7f\u7528JSON_QUERY<\/li>\n<li>JSON\u8def\u5f84\u8868\u8fbe\u5f0f\u533a\u5206\u5927\u5c0f\u5199<\/li>\n<li>JSON\u6570\u7ec4\u7d22\u5f15\u4ece0\u5f00\u59cb<\/li>\n<li>\u5927\u91cfJSON\u6570\u636e\u5904\u7406\u65f6,\u6ce8\u610f\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/li>\n<li>JSON\u51fd\u6570\u7684\u7ed3\u679c\u53ef\u4ee5\u4f5c\u4e3a\u5176\u4ed6SQL\u8bed\u53e5\u7684\u8f93\u5165<\/li>\n<li>\u5728\u4e8b\u52a1\u4e2d\u4f7f\u7528JSON\u51fd\u6570\u65f6,\u6ce8\u610f\u9501\u7684\u7c92\u5ea6<\/li>\n<p>\u51fd\u6570\u9009\u62e9\u6307\u5357:<\/p>\n<p>#publish-mermaid-1786238293100-7{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786238293100-7 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238293100-7 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786238293100-7 .error-icon{fill:#552222;}#publish-mermaid-1786238293100-7 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786238293100-7 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786238293100-7 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786238293100-7 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786238293100-7 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786238293100-7 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786238293100-7 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786238293100-7 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786238293100-7 .marker.cross{stroke:#333333;}#publish-mermaid-1786238293100-7 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786238293100-7 p{margin:0;}#publish-mermaid-1786238293100-7 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786238293100-7 .cluster-label text{fill:#333;}#publish-mermaid-1786238293100-7 .cluster-label span{color:#333;}#publish-mermaid-1786238293100-7 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786238293100-7 .label text,#publish-mermaid-1786238293100-7 span{fill:#333;color:#333;}#publish-mermaid-1786238293100-7 .node rect,#publish-mermaid-1786238293100-7 .node circle,#publish-mermaid-1786238293100-7 .node ellipse,#publish-mermaid-1786238293100-7 .node polygon,#publish-mermaid-1786238293100-7 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238293100-7 .rough-node .label text,#publish-mermaid-1786238293100-7 .node .label text,#publish-mermaid-1786238293100-7 .image-shape .label,#publish-mermaid-1786238293100-7 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786238293100-7 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786238293100-7 .rough-node .label,#publish-mermaid-1786238293100-7 .node .label,#publish-mermaid-1786238293100-7 .image-shape .label,#publish-mermaid-1786238293100-7 .icon-shape .label{text-align:center;}#publish-mermaid-1786238293100-7 .node.clickable{cursor:pointer;}#publish-mermaid-1786238293100-7 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786238293100-7 .arrowheadPath{fill:#333333;}#publish-mermaid-1786238293100-7 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786238293100-7 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786238293100-7 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238293100-7 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786238293100-7 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238293100-7 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786238293100-7 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786238293100-7 .cluster text{fill:#333;}#publish-mermaid-1786238293100-7 .cluster span{color:#333;}#publish-mermaid-1786238293100-7 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786238293100-7 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786238293100-7 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786238293100-7 .icon-shape,#publish-mermaid-1786238293100-7 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786238293100-7 .icon-shape p,#publish-mermaid-1786238293100-7 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786238293100-7 .icon-shape .label rect,#publish-mermaid-1786238293100-7 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786238293100-7 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786238293100-7 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786238293100-7 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node rect,#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].cluster rect,#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].swimlane.cluster rect{filter:none;}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].node circle .state-start{fill:#000000;}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238293100-7 [data-look=\\&#8221;neo\\&#8221;].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786238293100-7 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u63d0\u53d6\u6807\u91cf\u503c\u63d0\u53d6\u5bf9\u8c61\/\u6570\u7ec4\u5224\u65ad\u8def\u5f84\u5b58\u5728\u6784\u5efaJSON\u5bf9\u8c61\u6784\u5efaJSON\u6570\u7ec4JSON\u8f6c\u5173\u7cfb\u8868\u805a\u5408\u4e3aJSON\u6570\u7ec4<span class=\"nodeLabel\"><\/p>\n<p>JSON\u5904\u7406\u9700\u6c42<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u9700\u6c42\u7c7b\u578b<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_VALUE<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_QUERY<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_EXISTS<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_OBJECT<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_ARRAY<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_TABLE<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>JSON_ARRAYAGG<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: \u6807\u91cf\u503c<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: JSON\u5b57\u7b26\u4e32<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: BOOLEAN<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: JSON\u5bf9\u8c61\u5b57\u7b26\u4e32<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: JSON\u6570\u7ec4\u5b57\u7b26\u4e32<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: \u5173\u7cfb\u8868\u884c<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8fd4\u56de: JSON\u6570\u7ec4\u5b57\u7b26\u4e32<\/p>\n<p><\/span><\/p>\n<p>\u901a\u8fc7\u672c\u6587\u7684\u8be6\u7ec6\u4ecb\u7ecd,\u76f8\u4fe1\u8bfb\u8005\u5df2\u7ecf\u5bf9DM8\u6570\u636e\u5e93\u4e2d\u7684JSON\u51fd\u6570\u6709\u4e86\u5168\u9762\u7684\u4e86\u89e3\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d,\u5408\u7406\u4f7f\u7528JSON\u51fd\u6570\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u534a\u7ed3\u6784\u5316\u6570\u636e\u7684\u5904\u7406\u6d41\u7a0b,\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u5efa\u8bae\u8bfb\u8005\u6839\u636e\u5b9e\u9645\u4e1a\u52a1\u9700\u6c42,\u9009\u62e9\u5408\u9002\u7684JSON\u51fd\u6570,\u5e76\u9075\u5faa\u6700\u4f73\u5b9e\u8df5\u8fdb\u884c\u4f18\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218&#xff1a;\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e<br \/>\n\u4e00\u3001JSON\u51fd\u6570\u6982\u8ff0\u4e0e\u5e94\u7528\u573a\u666f<br \/>\n1.1 JSON\u6570\u636e\u683c\u5f0f\u7b80\u4ecb<br \/>\nJSON(JavaScript Object Notation)\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f,\u91c7\u7528\u5b8c\u5168\u72ec\u7acb\u4e8e\u8bed\u8a00\u7684\u6587\u672c\u683c\u5f0f,\u6613\u4e8e\u4eba\u9605\u8bfb\u548c\u7f16\u5199,\u540c\u65f6\u4e5f\u6613\u4e8e\u673a\u5668\u89e3\u6790\u548c\u751f\u6210\u3002JSON\u57fa\u4e8eJavaScript\u7684\u4e00\u4e2a\u5b50\u96c6,\u662f\u7406\u60f3\u7684\u534a\u7ed3\u6784\u5316\u6570\u636e\u5b58\u50a8\u683c\u5f0f\u3002<br \/>\n#publish-mermaid-1786238291865-0{font-family:\\&#8221;trebu<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11370,11371,93,768,3586],"topic":[],"class_list":["post-99391","post","type-post","status-publish","format-standard","hentry","category-server","tag-dm8","tag-json","tag-sql","tag-3586"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/99391.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218&#xff1a;\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e \u4e00\u3001JSON\u51fd\u6570\u6982\u8ff0\u4e0e\u5e94\u7528\u573a\u666f 1.1 JSON\u6570\u636e\u683c\u5f0f\u7b80\u4ecb JSON(JavaScript Object Notation)\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f,\u91c7\u7528\u5b8c\u5168\u72ec\u7acb\u4e8e\u8bed\u8a00\u7684\u6587\u672c\u683c\u5f0f,\u6613\u4e8e\u4eba\u9605\u8bfb\u548c\u7f16\u5199,\u540c\u65f6\u4e5f\u6613\u4e8e\u673a\u5668\u89e3\u6790\u548c\u751f\u6210\u3002JSON\u57fa\u4e8eJavaScript\u7684\u4e00\u4e2a\u5b50\u96c6,\u662f\u7406\u60f3\u7684\u534a\u7ed3\u6784\u5316\u6570\u636e\u5b58\u50a8\u683c\u5f0f\u3002 #publish-mermaid-1786238291865-0{font-family:&quot;trebu\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99391.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T07:04:18+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"29 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99391.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99391.html\",\"name\":\"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T07:04:18+00:00\",\"dateModified\":\"2026-09-02T07:04:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99391.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99391.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99391.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/99391.html","og_locale":"zh_CN","og_type":"article","og_title":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218&#xff1a;\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e \u4e00\u3001JSON\u51fd\u6570\u6982\u8ff0\u4e0e\u5e94\u7528\u573a\u666f 1.1 JSON\u6570\u636e\u683c\u5f0f\u7b80\u4ecb JSON(JavaScript Object Notation)\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6570\u636e\u4ea4\u6362\u683c\u5f0f,\u91c7\u7528\u5b8c\u5168\u72ec\u7acb\u4e8e\u8bed\u8a00\u7684\u6587\u672c\u683c\u5f0f,\u6613\u4e8e\u4eba\u9605\u8bfb\u548c\u7f16\u5199,\u540c\u65f6\u4e5f\u6613\u4e8e\u673a\u5668\u89e3\u6790\u548c\u751f\u6210\u3002JSON\u57fa\u4e8eJavaScript\u7684\u4e00\u4e2a\u5b50\u96c6,\u662f\u7406\u60f3\u7684\u534a\u7ed3\u6784\u5316\u6570\u636e\u5b58\u50a8\u683c\u5f0f\u3002 #publish-mermaid-1786238291865-0{font-family:\"trebu","og_url":"https:\/\/www.wsisp.com\/helps\/99391.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T07:04:18+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"29 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99391.html","url":"https:\/\/www.wsisp.com\/helps\/99391.html","name":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T07:04:18+00:00","dateModified":"2026-09-02T07:04:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99391.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99391.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99391.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"DM8 SQL\u8bed\u8a00\u4e2dJSON\u51fd\u6570\u5b9e\u6218\uff1a\u9ad8\u6548\u5904\u7406\u534a\u7ed3\u6784\u5316\u6570\u636e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99391"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99391\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99391"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}