谢谢版主们,但我实在太菜了,这个语句应该加在哪??
下面是我视图中的原始sql语句:
SELECT TOP 100 PERCENT dbo.wu_bom_no_工艺链.父件货号 AS A0,
dbo.wu_bom_no_工艺链.父件货名 AS A0货名,
dbo.wu_bom_no_工艺链.父件存货类型,
dbo.wu_bom_no_工艺链.父件工序 AS A0工序,
dbo.wu_bom_no_工艺链.子件货号 AS A1,
dbo.wu_bom_no_工艺链.子件货名 AS A1货名,
wu_bom_no_工艺链_1.父件工序 AS A1工序, dbo.wu_bom_no_工艺链.用量,
wu_bom_no_工艺链_1.子件货号 AS A2, wu_bom_no_工艺链_1.子件货名 AS A2货名,
wu_bom_no_工艺链_2.父件工序 AS A2工序, wu_bom_no_工艺链_2.子件货号 AS A3,
wu_bom_no_工艺链_2.子件货名 AS A3货名,
wu_bom_no_工艺链_3.父件工序 AS A3工序, wu_bom_no_工艺链_3.子件货号 AS A4,
wu_bom_no_工艺链_3.子件货名 AS A4货名,
wu_bom_no_工艺链_4.父件工序 AS A4工序, wu_bom_no_工艺链_4.子件货号 AS A5,
wu_bom_no_工艺链_4.子件货名 AS A5货名,
wu_bom_no_工艺链_5.父件工序 AS A5工序, wu_bom_no_工艺链_5.子件货号 AS A6,
wu_bom_no_工艺链_5.子件货名 AS A6货名,
wu_bom_no_工艺链_6.父件工序 AS A6工序, wu_bom_no_工艺链_6.子件货号 AS A7,
wu_bom_no_工艺链_6.子件货名 AS A7货名,
dbo.wu_bom_no_工艺链.父件货号 + '\' + dbo.wu_bom_no_工艺链.子件货号 + '\' + wu_bom_no_工艺链_1.子件货号
+ '\' + wu_bom_no_工艺链_2.子件货号 + '\' + wu_bom_no_工艺链_3.子件货号 + '\' + wu_bom_no_工艺链_4.子件货号
+ '\' + wu_bom_no_工艺链_5.子件货号 + '\' + wu_bom_no_工艺链_6.子件货号 AS 工艺路线
FROM dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_6 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_5 ON
wu_bom_no_工艺链_6.父件货号 = wu_bom_no_工艺链_5.子件货号 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_4 ON
wu_bom_no_工艺链_5.父件货号 = wu_bom_no_工艺链_4.子件货号 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_3 ON
wu_bom_no_工艺链_4.父件货号 = wu_bom_no_工艺链_3.子件货号 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_2 ON
wu_bom_no_工艺链_3.父件货号 = wu_bom_no_工艺链_2.子件货号 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 wu_bom_no_工艺链_1 ON
wu_bom_no_工艺链_2.父件货号 = wu_bom_no_工艺链_1.子件货号 RIGHT OUTER JOIN
dbo.wu_bom_no_工艺链 ON
wu_bom_no_工艺链_1.父件货号 = dbo.wu_bom_no_工艺链.子件货号
ORDER BY dbo.wu_bom_no_工艺链.父件货号 DESC