概述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 用法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)