orderlogistics(物流信息表)orderlogistics_id:自增iduserid:用户id,ordercode:订单号logistics:物流公司,字符型logisticsid:物流号yunfeistatuscustomer(客户表)customer_id:自增iduserid:用户id,usernamenicenamepro,city,dist,addr:收货地址,这里是4个字段,都是字符型,直接写入的省市区县地址的中文mobileorder(订单表)order_id:自增idproductname:商品名称inpricenumunitincurrencyotherexchange_ratecostoutpriceprofitordercode:订单号userid:用户id,customerid:自增idorderdatestatus有以上三个表,需要列出订单列表,订单列表所用到的字段如下:order_id,username,nicename,mobile,pro,city,dist,addr,logistics,logisticsid,status,cost,outprice,other,profit请问该如何写sql查询,sql不精,让各位见笑了。
2 回答
噜噜哒
TA贡献1784条经验 获得超7个赞
selecta.order_id,a.cost,a.outprice,a.other,a.profit,a.status,b.username,b.nicename,b.mobile,b.pro,b.city,b.dist,b.addr,c.logistics,c.logistics,fromorderaleftjoincustomerbona.customerid=b.customeridleftjoinorderlogisticsconb.userid=c.userid
添加回答
举报
0/150
提交
取消