var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to join tables in a way that make sense?
I am joining multiple tables, below are just my join statements. I wonder if it makes senses the order I join them. Please let me know, thank you.
FROM [Opt].[EDA].[I_DETAIL] as i_detail
full join [Opt].[EDA].[CONTRACT] as contract
full join [Opt].[EDA].[REGION] as region
on [REGION]. [SYSCODE]=[I_DETAIL].[REGIONSYSCODE]
full join [Opt].[EDA].[R_TYPE] as r_type
on [R_TYPE].[RTYPECODE] =[I_DETAIL] .[RTYPECODE]
full join [Opt].[EDA].[COMMODITY] as commodity
on [COMMODITY].[COMCODE]= [I_DETAIL].[SECONDCOMCODE]
full join [Opt].[EDA].[ADVERTISER]as advertiser
Not unless you specify
In that case, SQL Server will join the tables in the order you specify them. If force order is not specified, it is up to the query optimizer to choose the order of the tables, and I'd say it normally does so in an efficient manner.
option (force order)
Thanks, does this work in 2008? I have syntax error for some reason, dunno why.
As far as I knwo, there is nothing wrong with that join. What (precise) error message do you get?
i gotta ask...
Originally Posted by
why are you using FULL joins? are you ~sure~ you don't want INNER joins? how about even LEFT OUTER?
a bunch of FULL joins like that seems like such a shot in the dark...