Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-00918: column ambiguously defined

Status
Not open for further replies.

tcollins

Programmer
Sep 12, 2000
34
US
I have two tables, one with this weeks data, one with last weeks data. Both are identical except for the dates. I need to pull data from both tables, but I keep getting a "ORA-00918: column ambiguously defined" error message. This, of course, is because I told it to pull from the 'results' column, but both tables have this column. If I use an alias' to select the columns then I get a SELECT query like:
SELECT a.results, b.results FROM table1 a, table 2...
I desire not to have two seperate columns for the results. Is there any way to do a:
SELECT results from table1, table2...
without getting the above error? The example here is pretty simple as I'm actually pulling the same column ('results') from 7 different tables and cross referencing from other data sources.

Thank you.
 
make a union query.

Select results
from t1

union all
select results
from t2

etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top