首页 > 数据库 > mysql教程 > access 的多个left join 要加括号

access 的多个left join 要加括号

WBOY
发布: 2016-06-07 15:31:00
原创
1902 人浏览过

string sql = "select a.orderId,a.UserName,b.CodeValue as Delivery ,a.DeliveryAddress,a.PhoneNum,c.CodeValue as Payment,d.CodeValue as OrderStatus,d.CodeValue as OrderStatusID,a.OrderTime,a.Merchant from (( m_Order a "; sql += " left join (

 string sql = "select  a.orderId,a.UserName,b.CodeValue as Delivery ,a.DeliveryAddress,a.PhoneNum,c.CodeValue as Payment,d.CodeValue as OrderStatus,d.CodeValue as OrderStatusID,a.OrderTime,a.Merchant from  (( m_Order a ";

            sql += " left join ( select CodeId,CodeValue from M_DefaultValue where TableId='Delivery') as b on a.Delivery =b.CodeId )";

            sql += " left join ( select CodeId,CodeValue from M_DefaultValue where TableId='Payment') as  c on a.Payment=c.CodeId )";

            sql += " left join ( select CodeId,CodeValue from M_DefaultValue where TableId='OrderStatu') as d on a.OrderStatus =d.CodeId ";

标记一下

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板