Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

a simple problem with natural join

208428Mar 3 2006 — edited Mar 6 2006
i have 2 tables what have columns with distinct's names are referenced.

natural join not works 'cose only foreign key reference this 2 tables.

Have something to make table join in using an specific foreign key??
I'm using oracle9i

Example:
table a( a_cod number, a_name varchar2(20))
table b( b_cod number, b_month_year date, b_salary number)
ALTER TABLE b ADD ( CONSTRAINT b_a_FK FOREIGN KEY (b_cod)
REFERENCES a (a_cod));
select * from a natural join b
where trunc(b_month_year) = trunc(sysdate)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2006
Added on Mar 3 2006
9 comments
759 views