<bdo id='AF4zu'></bdo><ul id='AF4zu'></ul>

      <legend id='AF4zu'><style id='AF4zu'><dir id='AF4zu'><q id='AF4zu'></q></dir></style></legend>

    1. <tfoot id='AF4zu'></tfoot>

      <small id='AF4zu'></small><noframes id='AF4zu'>

      <i id='AF4zu'><tr id='AF4zu'><dt id='AF4zu'><q id='AF4zu'><span id='AF4zu'><b id='AF4zu'><form id='AF4zu'><ins id='AF4zu'></ins><ul id='AF4zu'></ul><sub id='AF4zu'></sub></form><legend id='AF4zu'></legend><bdo id='AF4zu'><pre id='AF4zu'><center id='AF4zu'></center></pre></bdo></b><th id='AF4zu'></th></span></q></dt></tr></i><div id='AF4zu'><tfoot id='AF4zu'></tfoot><dl id='AF4zu'><fieldset id='AF4zu'></fieldset></dl></div>
    2. 将 oracle 中的函数拆分为具有自动序列的逗号分隔值

      时间:2023-09-20
        <bdo id='oFeiv'></bdo><ul id='oFeiv'></ul>
        <legend id='oFeiv'><style id='oFeiv'><dir id='oFeiv'><q id='oFeiv'></q></dir></style></legend>

        <small id='oFeiv'></small><noframes id='oFeiv'>

            <tbody id='oFeiv'></tbody>
          <tfoot id='oFeiv'></tfoot>

            • <i id='oFeiv'><tr id='oFeiv'><dt id='oFeiv'><q id='oFeiv'><span id='oFeiv'><b id='oFeiv'><form id='oFeiv'><ins id='oFeiv'></ins><ul id='oFeiv'></ul><sub id='oFeiv'></sub></form><legend id='oFeiv'></legend><bdo id='oFeiv'><pre id='oFeiv'><center id='oFeiv'></center></pre></bdo></b><th id='oFeiv'></th></span></q></dt></tr></i><div id='oFeiv'><tfoot id='oFeiv'></tfoot><dl id='oFeiv'><fieldset id='oFeiv'></fieldset></dl></div>

                本文介绍了将 oracle 中的函数拆分为具有自动序列的逗号分隔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                需要 Split 函数,该函数将采用两个参数,要拆分的字符串和用于拆分字符串的分隔符,并返回一个包含 Id 和 Data 列的表.以及如何调用 Split 函数,该函数将返回一个包含 Id 和 Data 列的表.Id 列将包含序列,数据列将包含字符串的数据.例如.

                Need Split function which will take two parameters, string to split and delimiter to split the string and return a table with columns Id and Data.And how to call Split function which will return a table with columns Id and Data. Id column will contain sequence and data column will contain data of the string. Eg.

                SELECT*FROM Split('A,B,C,D',',')
                

                结果应采用以下格式:

                |Id | Data
                 --   ----
                |1  | A  |
                |2  | B  |
                |3  | C  |
                |4  | D  |
                

                推荐答案

                以下是创建此类表的方法:

                Here is how you could create such a table:

                 SELECT LEVEL AS id, REGEXP_SUBSTR('A,B,C,D', '[^,]+', 1, LEVEL) AS data
                   FROM dual
                CONNECT BY REGEXP_SUBSTR('A,B,C,D', '[^,]+', 1, LEVEL) IS NOT NULL;
                

                稍加调整(即,将 [^,] 中的 , 替换为一个变量),您就可以编写这样一个函数来返回一个表.

                With a little bit of tweaking (i.e., replacing the , in [^,] with a variable) you could write such a function to return a table.

                这篇关于将 oracle 中的函数拆分为具有自动序列的逗号分隔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:SQL 错误:ORA-01861:文字与格式字符串 01861 不匹配 下一篇:IF EXISTS 条件不适用于 PLSQL

                相关文章

              • <legend id='FMsu7'><style id='FMsu7'><dir id='FMsu7'><q id='FMsu7'></q></dir></style></legend>
                  <bdo id='FMsu7'></bdo><ul id='FMsu7'></ul>
              • <small id='FMsu7'></small><noframes id='FMsu7'>

                <i id='FMsu7'><tr id='FMsu7'><dt id='FMsu7'><q id='FMsu7'><span id='FMsu7'><b id='FMsu7'><form id='FMsu7'><ins id='FMsu7'></ins><ul id='FMsu7'></ul><sub id='FMsu7'></sub></form><legend id='FMsu7'></legend><bdo id='FMsu7'><pre id='FMsu7'><center id='FMsu7'></center></pre></bdo></b><th id='FMsu7'></th></span></q></dt></tr></i><div id='FMsu7'><tfoot id='FMsu7'></tfoot><dl id='FMsu7'><fieldset id='FMsu7'></fieldset></dl></div>
                  <tfoot id='FMsu7'></tfoot>