Skip to content
Advertisement

Error Oracle :query block has incorrect number of result columns

I have this query :

I know in union need to have the same columns Idk where is the problem In oracle i have this error:

Advertisement

Answer

Your union is between this query:

  • “SELECT ds.STOREID, ds.STORENAME, u.ALL_STORES, alus.STORE_ID, ds.STOREIDINT , TO_NUMBER(COALESCE(STORE_ID,’0′))”

and this query:

  • select to_number(AUCHAN_CODE) as AUCHAN_CODE , NAME

I believe you have a parenthesis out of place. Also, you can only sort by columns that are actually included in the union set. Try this:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement