gpt4 book ai didi

mysql - 将sql查询转换为xml格式

转载 作者:行者123 更新时间:2023-11-30 23:51:32 24 4
gpt4 key购买 nike

是否有任何工具或开源代码可以将 sql 查询 [不是查询结果] 转换为 xml。

示例:如果我有一个 SQL 查询,例如 select * from employee where empname='jon'。我想以 xml 格式生成此查询,如

<root>
<selectclause>
<field table=''....>
</selectclause>
</root>

需要任何插件或开源代码链接。

我正在使用 SQL Server 并且还需要扩展到 MySQL 数据库。但是,我在 C# 中为 .Net Framework 4 编写代码

最佳答案

select Customer_ID, Short_Name, Phone, Area,
sum(case when DATEDIFF(dd,Invoice_Date,GETDATE()) <= 21 then Balance end) '21 days',
sum(case when DATEDIFF(dd,Invoice_Date,GETDATE()) > 21 then Balance end) 'More than 21 days',
'' Visted, '' DLI, '' Collection
from vw_pending_invoice
where route = 1
group by Customer_ID, Short_Name, Phone, Area

关于mysql - 将sql查询转换为xml格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7356801/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com