sql server - SQL: Proper JOIN Protocol -
i have following tables following attributes:
op(opno, opname, date) opconvert(opno, m_opno, source_id, date) source(source_id, source_name, date) fleet(opno, s_no, date)
i have current multiple join query gives me results want:
select o.opno op_no, o.opname, o.date date_entered, c.* op o left outer join opconvert c on o.opno = c.opno left outer join source d on c.source_id = d.source_id c.opno not null
the problem this. need join fleet table on previous multiple join statement attach relevant s_no multiple join table. still able accomplish using left outer join or have use different join statement? also, table join on?
please note familiar left outer joins.
thanks.
i guess in case use inner join
or left join
(which same thing left outer join
in sql server.
inner join
means return records other tables if there corresponding records (based on join condition) infleet
table.left join
means return records other tables if there no corresponding records (based on join condition) infleet
table. columnsfleet
return null in case.
as table join, should join table makes more logical sense based on data structure.
Comments
Post a Comment