Home » SQL & PL/SQL » SQL & PL/SQL » amiguous definition??? (oracle 10g release 2)
amiguous definition??? [message #308178] Fri, 21 March 2008 14:23 Go to next message
horax
Messages: 34
Registered: March 2008
Member
This is getting annoying.

I am working with the brewbeans database provided in the book ORacle 10g developer, by Joan Casteel.

I have written a query that should work, but it keeps telling me taht I have a column that is ambiguously defined. Teh problem is that I am defning it by the table in the format:

table.column

The sql file is attached as a screen shot from SQL+ developer.

Any help would be GREATLY appreciated.
Tahnks!

hx
  • Attachment: 1_2_error.JPG
    (Size: 51.00KB, Downloaded 134 times)
Re: amiguous definition??? [message #308179 is a reply to message #308178] Fri, 21 March 2008 14:28 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have bb_basket twice in the FROM clause, how Oracle can know which one you want to reference at line 5?
You must give an alias to your tables in the FROM clause and use this alias in the WHERE clause.

Regards
Michel

[Updated on: Fri, 21 March 2008 14:29]

Report message to a moderator

Re: amiguous definition??? [message #308182 is a reply to message #308179] Fri, 21 March 2008 14:42 Go to previous messageGo to next message
horax
Messages: 34
Registered: March 2008
Member
Ok, so if I hear you correctly, you can only reference each table ONCE in a WHERE clause?

If I am relating three different tables (let's call them A, B, and C) I can set up a relation in the WHERE clauses for A=B, B=C format ONLY if I use an ALIAS?
Re: amiguous definition??? [message #308186 is a reply to message #308182] Fri, 21 March 2008 15:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
you can only reference each table ONCE in a WHERE clause?

No you can reference any number of times you want but if you use several times the same table you must use an alias that allow to distinct them.

You don't use 3 tables, you use 5 tables but twice two of them.

Regards
Michel
Re: amiguous definition??? [message #308188 is a reply to message #308186] Fri, 21 March 2008 15:23 Go to previous message
horax
Messages: 34
Registered: March 2008
Member
gothca, thanks!
Previous Topic: convert seconds to HH:MI:SS for large numbers in seconds
Next Topic: Help in TRIGGER
Goto Forum:
  


Current Time: Fri Dec 02 21:04:42 CST 2016

Total time taken to generate the page: 0.12331 seconds