home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,117 of 19,505   
   Erland Sommarskog to Raul Rego   
   Re: data retrieve on parent and many chi   
   28 Oct 14 11:37:13   
   
   From: esquel@sommarskog.se   
      
   Raul Rego (rrego@pmchnnj.org) writes:   
   > NOW can I issue multiple JOIN like this join CodeValue   
   >      on codevalue.CodeID = toxpat.calltype .  reason being is Codevalue   
   >      table has the definitions for many fields numeric entries   
   > For example, I will also like to use:   
   > Join Codevalue on Codevalue.CodeID = toxpat.ReasonCall   
   >   
   > is it possible to issue multiple Join codevalue on codevalue.codeId = >   
   > toxpat.Column1, column2, etc   
      
      
   Once you start to learn to use aliass (which you should because it enhances   
   reaability), it all comes naturally:   
      
   SELECT tp.CaseNumber, tp.StartDate, tes.SubDesc,   
         tes.SubPoisindexCode, cv_ct.CodeValue as "Call Type",   
         cv_rc.CodeValue AS "Reason to Call"   
   from ToxExpSub  tes   
   join Toxpat tp  on tp.CaseNumber = tes.CaseNumber   
   join CodeValue  on cv_ct.CodeID = tp.calltype   
   join CodeValue  on cv_rc.CodeID = tp.ReasonToCall   
   where exists (   
        select 1 from ToxExpSub x   
        where x.SubPoisindexCode = 6931087   
          and x.CaseNumber = tp.CaseNumber   
   )   
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Books Online for SQL Server 2005 at   
   http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx   
   Books Online for SQL Server 2000 at   
   http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca