How to resolve ORA 00936 Missing Expression Error?

user1466466 picture user1466466 · Aug 28, 2012 · Viewed 165.3k times · Source
Select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL,
ltrim(rtrim(substr(oled, 9, 16))) as VALUE,
from rrfh a, rrf b,
where ltrim(rtrim(substr(oled, 1, 9))) = 'stata kish' 
and a.xyz = b.xyz 

The "from " (3rd line) part of the above query is giving me ORA-00936 Missing EXPRESSION error. Please Help me

NOTE :: rrfh table contains no data.

Answer

Adriaan Stander picture Adriaan Stander · Aug 28, 2012

Remove the comma?

select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL,
ltrim(rtrim(substr(oled, 9, 16))) as VALUE
from rrfh a, rrf b
where ltrim(rtrim(substr(oled, 1, 9))) = 'stata kish' 
and a.xyz = b.xyz

Have a look at FROM

SELECTING from multiple tables You can include multiple tables in the FROM clause by listing the tables with a comma in between each table name