This content has been marked as final. Show 4 replies
I can't reproduce it:
select prod_cd, client_id from products, cases where prod_cd = client_id / no rows selected SQL>
Maybe try this:
It works either way for me.
SELECT p.prod_cd, c.client_id FROM products p, cases c WHERE p.prod_cd = c.client_id;
979105 wrote:I suspect that's not the query you're actually running. If it were, you would get a different error message because SELECT is mis-spelled.
... However, if I try this query
selelct prod_cd, client_id from products, cases where prod_cd = client_id
ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
Error at Line: 7 Column: 7
I can't re-create the problem, either.
Even if it's not strictly necessary, MLBrown's suggestions is good. Whenever you have 2 or more tables in the same query, it's a good idea to qualify all column names with the table name or alias. It makes debugging easier, especially for someone who's not very familiar with the tables (and that may be you in the future).
Those are not the way the tables are defined. That error message is telling you that either prod_cd or client_id (or both) are columns in both tables and it doesn't know which one to use.