从 SQL select 语句获取 XML 文件

问题描述

<root>
      
   <parent> 
        <name>s</name>
        <age>23</age>
        <child>child</child>
        <country>country</country>        
     </parent>

   <parent> 
        <name>t</name>
        <child>child</child>
     </parent>

    <parent> 
        <name>t</name>
        <child>child</child>
        <country>country</country>
     </parent>
</root>

我正在编写一个 sql 选择语句,然后使用 xml 路径将其更改为 xml。但是,为什么我在每个小节中得到不同数量的元素,如上所示。 如何解决

注意:我在 Azure sql 服务器上运行选择查询

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)