Re: 'XYZ' AS in union query gives ORA-00918
- From: "fitzjarrell@xxxxxxx" <oratune@xxxxxxx>
- Date: Mon, 21 Jul 2008 05:13:41 -0700 (PDT)
On Jul 21, 6:02 am, Thomas Poenicke <poeni...@xxxxxxxxxx> wrote:
Hi,
I've created an union query like this:
select 'DB' AS SRC, some fields from a table
union
select 'UP' AS SRC, some fields from a view
order by 1 -- <-- id primary key
Both - table and view - have the same columns an without the "AS SRC"
fields the query is corecctly processed.
Why Oracle throws me an 'ORA-00918: column ambiguously defined...'
with the additional Column?
The sense of the query is to show changed data before applying the
changes.
The new and old rows are displayed together but without the SRC column
only an insider knows, what the source of the row is.
Thanks in advance and sorry for my cruel english ;)
Thomas
We need to see what you've written for these 'other columns from'
parts of the UNION; you should have posted the entire query as
written.
Do so, as we can't know what your issues are until you post that
entire query text.
David Fitzjarrell
.
- Prev by Date: Legacy-software
- Next by Date: ***y puictures
- Previous by thread: Legacy-software
- Next by thread: Re: 'XYZ' AS in union query gives ORA-00918
- Index(es):