首頁  >  文章  >  資料庫  >  access 的多个left join 要加括号

access 的多个left join 要加括号

WBOY
WBOY原創
2016-06-07 15:31:001867瀏覽

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 ";

标记一下

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn