+ 1 for the join....it's the caffeine IMHO ;-) *Bryan Stevenson*B.Comm. President & CEO Electric Edge Systems Group Inc. - makers of FACTS^(TM) phone: 250.480.0642 cell: 250.920.8830 e-mail: br...@electricedgesystems.com <mailto:br...@electricedgesystems.com> web: www.electricedgesystems.com <http://www.electricedgesystems.com> and www.fisheryfacts.com <http://www.fisheryfacts.com>
------------------------------------------------------------------------ Please consider the environment before printing this e-mail -----CONFIDENTIALITY------ This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. On 13-12-05 05:04 PM, Michael Dinowitz wrote: > I've got an applicant table that including an ethnicity id. I need to > convert the id into a text value from a separate ethnicity lookup table > (with less than 10 entries). I can: > 1. Do a subquery against the ethnicity table in the select part of the > query and alias the return value > 2. Do a join to the ethnicity table > > My tests on SQL 2008 show that the subquery can run into some wait time on > the server and seems to be slower and less efficient. This leads me to > think that using a join is the best idea. Would this be the general > consensus? Somehow joining to a lookup table feels wrong, but that might > just be the caffeine. :) > > Thanks > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3519 Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/sql/unsubscribe.cfm