<small id='6uoPr'></small><noframes id='6uoPr'>

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

      <bdo id='6uoPr'></bdo><ul id='6uoPr'></ul>
  1. <tfoot id='6uoPr'></tfoot>

    1. 在 SQL Server XPath 中获取跟随兄弟

      时间:2023-06-07
      <tfoot id='GUoLa'></tfoot>
        <tbody id='GUoLa'></tbody>

            <legend id='GUoLa'><style id='GUoLa'><dir id='GUoLa'><q id='GUoLa'></q></dir></style></legend>
            • <small id='GUoLa'></small><noframes id='GUoLa'>

            • <i id='GUoLa'><tr id='GUoLa'><dt id='GUoLa'><q id='GUoLa'><span id='GUoLa'><b id='GUoLa'><form id='GUoLa'><ins id='GUoLa'></ins><ul id='GUoLa'></ul><sub id='GUoLa'></sub></form><legend id='GUoLa'></legend><bdo id='GUoLa'><pre id='GUoLa'><center id='GUoLa'></center></pre></bdo></b><th id='GUoLa'></th></span></q></dt></tr></i><div id='GUoLa'><tfoot id='GUoLa'></tfoot><dl id='GUoLa'><fieldset id='GUoLa'></fieldset></dl></div>
                <bdo id='GUoLa'></bdo><ul id='GUoLa'></ul>
                本文介绍了在 SQL Server XPath 中获取跟随兄弟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                由于 SQL Server 不支持跟随兄弟轴 - 获得它的最佳方法是什么?假设我有这样的 XML,我想在匹配值 'dog' 的节点之后获取第一个 'b' 节点:

                Since SQL Server does not support following-sibling axis - what is the best way to get it? Let's say I have XML like this and I would like to get the first 'b' node after a node matching the value 'dog':

                <root>
                    <a>cat</a>
                    <b>Cats don't like milk</b>
                    <a>dog</a>
                    <b>Dogs like everything</b>
                </root>
                

                推荐答案

                你可以尝试这样的事情.

                You could try something like this.

                declare @X xml = '
                <root>
                    <a>cat</a>
                    <b>Cats don''t like milk</b>
                    <a>dog</a>
                    <c>not this</c>
                    <b>Dogs like everything</b>
                    <b>and not this</b>
                </root>'
                
                select @X.query('(/root/b[. >> (/root/a[. = "dog"])[1]])[1]')
                

                这篇关于在 SQL Server XPath 中获取跟随兄弟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Oracle XMLTable-从父节点获取列 下一篇:在 SQL Server 中选择 XML 元素

                相关文章

                最新文章

                <legend id='5xQa0'><style id='5xQa0'><dir id='5xQa0'><q id='5xQa0'></q></dir></style></legend>

                    <small id='5xQa0'></small><noframes id='5xQa0'>

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