Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #1826 > unrolled thread
| Started by | Raul Rego <rrego@pmchnnj.org> |
|---|---|
| First post | 2014-10-28 03:02 -0700 |
| Last post | 2014-10-28 13:33 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.databases.ms-sqlserver
multiple JOIN for same table and column lookup Raul Rego <rrego@pmchnnj.org> - 2014-10-28 03:02 -0700
Re: multiple JOIN for same table and column lookup Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2014-10-28 13:33 +0100
| From | Raul Rego <rrego@pmchnnj.org> |
|---|---|
| Date | 2014-10-28 03:02 -0700 |
| Subject | multiple JOIN for same table and column lookup |
| Message-ID | <415a780c-2e4c-4f20-9571-c8de38856cdf@googlegroups.com> |
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,
[toc] | [next] | [standalone]
| From | Lennart Jonsson <erik.lennart.jonsson@gmail.com> |
|---|---|
| Date | 2014-10-28 13:33 +0100 |
| Message-ID | <m2o2es$bjd$1@dont-email.me> |
| In reply to | #1826 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.databases.ms-sqlserver
csiph-web