SELECT distinct a.goodscode,a.goodsname,b.cost,d.total,d.taxrate,d.preferential,c.Rebate1,c.Rebate2,c.integral,c.typeid as code ,c.proportion1,c.proportion2,a.money,a.goodscode,a.price,b.gyp,b.Goodsproportion,b.s1,b.s2,b.y1,b.y2,b.s1_a,
b.s2_a,b.y1_a,b.y2_a,d.preferential,a.gypcb,b.Manager,b.Assistant,b.inspector,b.AirFROM t_billdetail a, t_goods b,客户价格表 c,t_bill d where a.billcode='XS000097' and a.goodscode=b.goodscode and b.goodsid=c.cpid and a.billcode=d.billcode and a.ChargesNo=1
///////////////////////////////////////////////////////////////////////////////////////////////////
查询结果如下:
HD-1001 aaaaaa .0000 15700.000
HD-3001 bbbbbb .0000 15700.000
HD-3001 bbbbbb .0000 15700.000
MT-916 ddddd 20.0000 15700.000
//////////////////////////////////////////////////////////////////////////////////////////////
------解决方案--------------------
SELECT distinct a.goodscode,a.goodsname,b.cost,d.total,d.taxrate,d.preferential,c.Rebate1,c.Rebate2,c.integral,c.typeid as code ,c.proportion1,c.proportion2,a.money,a.goodscode,a.price,b.gyp,b.Goodsproportion,b.s1,b.s2,b.y1,b.y2,b.s1_a,这个结果是什么?你的数据对不上,看不懂
b.s2_a,b.y1_a,b.y2_a,d.preferential,a.gypcb,b.Manager,b.Assistant,b.inspector,b.AirFROM t_billdetail a, t_goods b,客户价格表 c,t_bill d where a.billcode='XS000097' and a.goodscode=b.goodscode and b.goodsid=c.cpid and a.billcode=d.billcode and a.ChargesNo=1