0

下面是我的 SQL 以及上面的错误。我不知道问题是什么了。我已经尝试了很多。有人可以帮忙吗?

错误:生成的 SELECT 语句语法错误:在列别名或“*”之后需要“,”或“FROM” 要将这些组件添加到数据集,请单击“完成”。

SELECT ALCIE.POLINE.DISTDIV
    , ALCIE.POLINE.DISTDEPT
    , ALCIE.POLINE.DISTGL
    , ALCIE.POLINE.LINENO
    , ALCIE.POLINE.ITEM
    , ALCIE.POLINE.ITEMDES1
    , ALCIE.POLINE.ITEMDES2
    , ALCIE.POLINE.PO
    , ALCIE.POLINE.PODATE
    , ALCIE.POLINE.PURCHUOM
    , ALCIE.POLINE.QTYORD
    , ALCIE.POLINE.CUMQTYREC
    , ALCIE.POLINE.UNITCOST
    , ALCIE.POLINE.CUMQTYREC * ALCIE.POLINE.UNITCOST AS EXPR1
    , ALCIE.POLINE.RECDATE
    , ALCIE.POLINE.VENDOR
    , ALCIE.APMASTER.NAME1
    , ALCIE.POLINE.STATUS
    , ALCIE.POHEADER.STATUS AS EXPR2
    , ALCIE.POLINE.STKLOC
    , ALCIE.POLINE.LAST_REC_USERID
    , ALCIE.POLINE.ITEMDES3
    , 'ALCIE_POLINE.PO' || 'ALCIE_POLINE.LINENO' AS EXPR3
    , ALCIE.POHEADER.COMMENTS4
FROM ALCIE.POLINE, ALCIE.POHEADER, ALCIE.APMASTER
WHERE ALCIE.POLINE.CO = ALCIE.POHEADER.CO 
    AND ALCIE.POLINE.PO = ALCIE.POHEADER.PO 
    AND ALCIE.POHEADER.CO = ALCIE.APMASTER.CO 
    AND ALCIE.POHEADER.VENDOR = ALCIE.APMASTER.VENDOR 
    AND (ALCIE.POLINE.CO = 'WSA') 
    AND (ALCIE.POLINE.PO = :EnterPoNumber)
ORDER BY ALCIE.POLINE.ITEMDES1, ALCIE.POLINE.PO
4

2 回答 2

0

尝试这个:

选择 ALCIE.POLINE.DISTDIV,
ALCIE.POLINE.DISTDEPT,
ALCIE.POLINE.DISTGL,
ALCIE.POLINE.LINENO,
ALCIE.POLINE.ITEM,
ALCIE.POLINE.ITEMDES1,
ALCIE.POLINE.ITEMDES2,
ALCIE.POLINE.PO,
ALCIE.POLINE.PODATE,
ALCIE.POLINE.PURCHUOM,
ALCIE.POLINE.QTYORD,
ALCIE.POLINE.CUMQTYREC,
ALCIE.POLINE.UNITCOST,
ALCIE.POLINE.CUMQTYREC * ALCIE.POLINE.UNITCOST AS EXPR1,
ALCIE.POLINE.RECDATE,
ALCIE.POLINE.供应商,
ALCIE.APMASTER.NAME1,
ALCIE.POLINE.STATUS,
ALCIE.POHEADER.STATUS 作为 EXPR2,
ALCIE.POLINE.STKLOC,
ALCIE.POLINE.LAST_REC_USERID,
ALCIE.POLINE.ITEMDES3,
(ALCIE.POLINE.PO | ALCIE.POLINE.LINENO) 作为 EXPR3,
ALCIE.POHEDER.COMMENTS4
来自 ALCIE.POLINE、ALCIE.POHEADER、ALCIE.APMASTER
其中 ALCIE.POLINE.CO = ALCIE.POHEADER.CO
    和 ALCIE.POLINE.PO = ALCIE.POHEADER.PO
    和 ALCIE.POHEADER.CO = ALCIE.APMASTER.CO
    和 ALCIE.POHEADER.VENDOR = ALCIE.APMASTER.VENDOR
    和(ALCIE.POLINE.CO = 'WSA')
    AND (ALCIE.POLINE.PO = :EnterPoNumber)
由 ALCIE.POLINE.ITEMDES1、ALCIE.POLINE.PO 订购
于 2012-07-18T18:23:39.753 回答
0

就我而言,问题出在 select 语句上,您需要将所有计算转换TO_NUMBER为如下:

尝试这个:

SELECT
   TO_NUMBER(TABLE_NAME.COLUMN * TABLE_NAME.COLUMN) AS EXPR1, 
   TO_NUMBER(TABLE_NAME.COLUMN * 100) AS EXPR2
FROM TABLE_NAME
于 2019-05-14T12:20:12.810 回答