Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Lennart Jonsson Newsgroups: comp.databases.ms-sqlserver Subject: Re: multiple JOIN for same table and column lookup Date: Tue, 28 Oct 2014 13:33:38 +0100 Organization: A noiseless patient Spider Lines: 34 Message-ID: References: <415a780c-2e4c-4f20-9571-c8de38856cdf@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 28 Oct 2014 12:33:32 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="5f53882e1b0b5de864e88de647f19c93"; logging-data="11885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186rqGbai2xzgtTnGAp6mtE" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <415a780c-2e4c-4f20-9571-c8de38856cdf@googlegroups.com> Cancel-Lock: sha1:F+97nNxfryZyqnOXBoJ9ppHOWNE= Xref: csiph.com comp.databases.ms-sqlserver:1830 On 2014-10-28 11:02, Raul Rego wrote: > I have the following select: > ELECT ToxPat.CaseNumber, ToxPat.StartDate, ToxExpSub.SubDesc > > , ToxExpSub.SubPoisindexCode, CodeValue.CodeValue as 'Call Type' > from ToxExpSub > > join Toxpat > on ToxPat.CaseNumber = ToxExpSub.CaseNumber > join CodeValue > on codevalue.CodeID = toxpat.calltype > > I just received valuable help on how to retrieve child records NOW I need help on the select codevalue.codevalue AND join CodeValue > on codevalue.CodeID = toxpat.calltype > > I have many columns with numeric entries where their vertatim values or in the table codevalue thus: > I need multiple JOIN codevalue on codevalue.CODEID = toxpat.reason, calltype, outcome etc. > > how can I do this? > > thanks, > Do you mean: ON codevalue.CODEID IN (toxpat.reason, toxpat.calltype, toxpat.outcome, ...) ? /Lennart