生成所有货品条码(货品颜色定义的颜色才有条码):
select a.goodscode+a.colorcode+b.sizecode as BarCode from (select g.Code as goodscode,c.No as colorcode from M_Goods g left join M_Tabs_GoodsStuff gc on g.GoodsID=gc.GoodsID
left join M_Color c on c.ColorID=gc.ColorID) a,(select Code as sizecode from M_Size) b
select a.goodscode+a.colorcode+b.sizecode as BarCode from (select g.Code as goodscode,c.No as colorcode from M_Goods g left join M_Tabs_GoodsStuff gc on g.GoodsID=gc.GoodsID
left join M_Color c on c.ColorID=gc.ColorID) a,(select Code as sizecode from M_Size) b