문제

I have a task to do from the university and I need help. I need to join tables, are two tables employer and departament:

departament(id, description)

employer(id, name, age, dep_id);

I'm using oracle 11, could some friendly person give the way?

도움이 되었습니까?

해결책

well... I think there is another topic like this, but let's help you.

The way is: you can use inner join...

Taking your example:

select * from employer inner join departament on employer.dep_id = departament.id;

taking the opportunity, I would like to suggest you to study also outer join, left join, right join and of course also inner join.

다른 팁

Do you need something like this? (the very easiest one)

SELECT * FROM EMPLOYER e, DEPARTAMENT d WHERE e.DEP_ID = d.ID

But I prefer using inner/outer/left/right joins :-)

For explanation see:

What is the difference between Left, Right, Outer and Inner Joins?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top