0

当我执行下面的查询时,它会出现错误,就像"ORA-00904: "R"."MEASURE": invalid identifier"
我认为查询没有错一样。但我找不到问题。你能帮我吗...谢谢。

SELECT  DISTINCT 0 ROW_ID,  Division , Outlet , Class , Package , Type , Measure 
FROM       NEW_OUTLET_TOTAL_PLAN_2013 S 
WHERE   NOT EXISTS
(SELECT  1
FROM    TEMP_BWXROW3  R 
WHERE   
R.Division = S.Division AND 
R.Outlet = S.Outlet AND 
R.Class = S.Class AND 
R.Package = S.Package AND 
r.type = s.type and 
R.Measure = S.Measure );
4

2 回答 2

1

执行这个:

SELECT *
  FROM USER_TAB_COLS
  WHERE UPPER(TABLE_NAME) = 'TEMP_BWXROW3' AND
        UPPER(COLUMN_NAME) = 'MEASURE'

这将向您显示使用的确切列名。密切注意列名的大小写(大写、小写或混合)。如果不是全部大写(即“MEASURE”),则在使用时需要用双引号将列名括起来。因此,例如,如果实际列名是“测量”,您需要将查询更改为

SELECT  DISTINCT 0 ROW_ID,  Division , Outlet , Class , Package , Type , Measure
FROM       NEW_OUTLET_TOTAL_PLAN_2013 S 
WHERE   NOT EXISTS
(SELECT  1
FROM    TEMP_BWXROW3  R 
WHERE   
R.Division = S.Division AND 
R.Outlet = S.Outlet AND 
R.Class = S.Class AND 
R.Package = S.Package AND 
r.type = s.type and 
R."Measure" = S.Measure);

分享和享受。

于 2013-04-22T12:17:56.017 回答
0

TEMP_BWXROW3 中有区分大小写的列名吗?如果是这样,请使用 R."Measure" ...

于 2013-04-22T11:57:52.657 回答