关于sql 列转行,总是提示标识符无效
这个是代码WITHAAS(SELECTP_ID,NAMEFROMA_TEST_PERSONT),WITHBAS(SELECTORDERPRICE,CUSTOMER_ID,...
这个是代码 WITH A AS (SELECT P_ID,NAME FROM A_TEST_PERSON T),WITH B AS (SELECT ORDERPRICE, CUSTOMER_ID,O_ID FROM A_TEST_ORDERS O)SELECT NAME,产品1,产品2,产品3,产品4,产品5,产品6,产品7,产品8,产品9,产品10,产品11,产品12,SUM(to_number(ORDERPRICE)) AS PRICETOTALFROM A,BPIVOT (MAX(ORDERPRICE) FOR O_ID IN('产品1' AS 产品1,'产品2' AS 产品2,'产品3' AS 产品3,'产品4'AS 产品4,'产品5' AS 产品5,'产品6' AS 产品6,'产品7' AS 产品7,'产品8' AS 产品8,'产品9' AS 产品9,'产品10' AS 产品10,'产品11' AS 产品11,'产品12' AS 产品12))
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询