I have a database with one table for Descriptions in different languages, with LanguageID, TableName, ForeignID and Description.
When I need to join this Descriptions table, I naturally join on TableName.ID = ForeignID. But where do you recommend putting the condition for TableName and LanguageID?
Or like this?
asked Dec 20, 2010 at 11:49 PM in Default
answered Dec 21, 2010 at 12:04 AM
Matt Whitfield ♦♦
As far as I am aware, both of these will result in the same execution plan. I think I prefer the first example, simply because the join conditions are kept together with the joins themselves. The second example makes me look at the joins, then the where clause, then back at the joins to see what the aliases are.
I think it is a thing of preference only.
My 2 cents :o)
answered Dec 20, 2010 at 11:59 PM