我自己现在用的下面代码。兄弟们看一下有什么改进:
SELECT 款号,颜色,数量 as M FROM a WHERE 码尺='M' INTO CURSOR a1
SELECT 款号,颜色,数量 as L FROM a WHERE 码尺='L' INTO CURSOR a2
SELECT 款号,颜色,数量 as XL FROM a WHERE 码尺='XL' INTO CURSOR a3
SELECT 款号,颜色,数量 as XXL FROM a WHERE 码尺='XXL' INTO CURSOR a4
SELECT 款号,颜色,数量 as XXXL FROM a WHERE 码尺='XXXL' INTO CURSOR a5
SELECT NVL(a1.款号,a2.款号) 款号,NVL(a1.颜色,a2.颜色) 颜色,NVL(a1.M,000000) M,NVL(a2.L,000000) L FROM ;
a1 FULL JOIN a2 ON a1.款号=a2.款号 AND a1.颜色=a2.颜色 INTO CURSOR b1
SELECT NVL(b1.款号,a3.款号) 款号,NVL(b1.颜色,a3.颜色) 颜色,NVL(b1.M,000000) M,NVL(b1.L,000000) L,NVL(a3.XL,000000) XL FROM ;
b1 FULL JOIN a3 ON b1.款号=a3.款号 AND b1.颜色=a3.颜色 INTO CURSOR b1
SELECT NVL(b1.款号,a4.款号) 款号,NVL(b1.颜色,a4.颜色) 颜色,NVL(b1.M,000000) M,NVL(b1.L,000000) L,NVL(b1.XL,000000) XL,NVL(a4.XXL,000000) XXL FROM ;
b1 FULL JOIN a4 ON b1.款号=a4.款号 AND b1.颜色=a4.颜色 INTO CURSOR b1
SELECT NVL(b1.款号,a5.款号) 款号,NVL(b1.颜色,a5.颜色) 颜色,NVL(b1.M,000000) M,NVL(b1.L,000000) L,NVL(b1.XL,000000) XL,NVL(b1.XXL,000000) XXL,NVL(a5.XXXL,000000) XXXL FROM ;
b1 FULL JOIN a5 ON b1.款号=a5.款号 AND b1.颜色=a5.颜色 INTO CURSOR b1