-
inner join
[Originally posted by Croy]
I have 2 tables i want to connect by inner join.
one is "Education_subects" (has fields: "subject_id" & "subject_desc"), and the other table is "employee_education" (has fields: "emoloyee_number", "subject_id_1", "subject_id_2").
now, i want to connect both fields "subject_id_1" & "subject_id_2" to the field "subject_id" in the first table.
how do i do it.
in other words, i do i connect 2 tables in more then one field?
-
Re:inner join
[Originally posted by Jim]
select fields
from tbl1 inner join tbl2
on tbl1.field1 = tbl2.field1
and tbl1.field2 = tbl2.field2
-
Re:Re:inner join
[Originally posted by Croy]
hi jim
the problem is that i want to connect field1 and field2 from tbl1 to the same field(!) in tbl2.
can i do it?
thanks.
-
Re:Re:Re:inner join
[Originally posted by Jim]
Is this what you need?
select e.employee_number, s1.subject_desc, s2.subject_desc from employee_education e left join education_subjects s1 on e.subject_id_1 = s1.subject_id left join education_subjects s2 on e.subject_id_2 = s2.subject_id
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|