Oracle Query giving error

后端 未结 1 572
猫巷女王i
猫巷女王i 2020-12-12 08:04

I m running below query in toad to test the result but I am getting error as

ORA-00933: SQL command not properly ended

here is m

相关标签:
1条回答
  • 2020-12-12 08:59

    Your two larger SELECTS (the first 2) are returning 12 items. The last two SELECTS (the small ones) are returning 13 items. UNION must have matching columns.

    eg statement should end...

    SELECT NULL, 0, 'ABC', NULL, NULL, NULL,
    'ABC', NULL, NULL, NULL, NULL, NULL
    FROM DUAL
    
    UNION
    
    SELECT NULL, 0, 'XYZ', NULL, NULL, NULL,
    'XYZ', NULL, NULL, NULL, NULL, NULL
    FROM DUAL
    
    0 讨论(0)
提交回复
热议问题