Sqlserver case...when + union 用法

Sqlserver case...when + union 用法,第1张

概述SELECT a.user_id, a.package_id, a.addtime, a.result, b.package_name + '' + b.package_price + '' + b.package_traffic+ '' + case b.type when 1 then '(后付费)' else '(预付费)' END package_name FROM xzllgj_user SELECT a.user_ID,a.package_ID,a.addtime,a.result,b.package_name + '' + b.package_price + '' + b.package_traffic+ '' + case b.type when 1 then '(后付费)' else '(预付费)' END package_name FROM xzllgj_user_traffic a left JOIN xzllgj_traffic_package b ON a.package_ID = b.package_ID WHERE user_ID = 'xxxxx' UNION SELECT c.user_ID,c.package_ID,c.addtime,c.result,d.package_name + '' + d.package_price + '' + d.package_traffic+ '' + case d.type when 1 then '(后付费)' else '(预付费)' END package_name FROM xzllgj_user_traffic_failure c left JOIN xzllgj_traffic_package d ON c.package_ID = d.package_ID WHERE user_ID = 'xxxxx' 总结

以上是内存溢出为你收集整理的Sqlserver case...when + union 用法全部内容,希望文章能够帮你解决Sqlserver case...when + union 用法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1172189.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存