i have three tables
1- room_info with four fields
field_name data_type description
---------- ---------- -----------
r_id number primary key
r_number number
r_floor text
1- student_info with five fields
field_name data_type description
---------- ---------- -----------
s_id number primary key
s_name text
s_college text
s_dept text
r_id number foreign key
3- como_info with five fields
field_name data_type description
---------- ---------- -----------
c_id number primary key
c_sys number
c_dosh number
c_dol number
r_id number foreign key
r_id from room_info is foreign key for both como_info and student_info
i want to make select query to select s_name,s_college,c_sys,c_dosh???
i use c# and access 2010
Loading

Sanjeeb LenkaPosted Aug 2, 2013, 11:23 AM
Select student_info.s_name,student_info.s_college,como_info.c_sys,como_info.c_dosh
from (student_info
inner join como_info on como_info.r_id=student_info.r_id)
SUNIL GUTTAPosted Aug 5, 2013, 3:26 AM
Iftikar HussainPosted Aug 5, 2013, 3:04 AM
Regards,
Iftikar
SUNIL GUTTAPosted Aug 5, 2013, 3:01 AM
Iftikar HussainPosted Aug 5, 2013, 2:59 AM
room_info is parent table where r_id is PK and
student_info and como_info are child table with relation of r_id as FK
Regards,
Iftikar
SUNIL GUTTAPosted Aug 5, 2013, 2:54 AM
Iftikar HussainPosted Aug 5, 2013, 1:59 AM
Regards,
Iftikar
SUNIL GUTTAPosted Aug 4, 2013, 1:38 PM
Well same doubt for me in-case of ur query also i.e in ur second INNERJOIN u created a relation between 2 foreign keys :) which is not in practice ..
I finally hope the above question may be wrongly mentioned so i got this little confusion
Iftikar HussainPosted Aug 4, 2013, 11:22 AM
Regards,
Iftikar
SUNIL GUTTAPosted Aug 4, 2013, 11:06 AM
como_info.r_id=student_info.r_id how could we relate tables using 2 foreign keys mate ?? made be one of this is a primary key [r_id] ???
honar abubakrPosted Aug 2, 2013, 2:25 PM
Iftikar HussainPosted Aug 2, 2013, 12:23 PM
Try like this
Regards,
Iftikar