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,120 of 19,505   
   Erland Sommarskog to Raul Rego   
   Re: adding a column to select   
   01 Nov 14 15:06:32   
   
   From: esquel@sommarskog.se   
      
   Raul Rego (rrego@pmchnnj.org) writes:   
   > Can I go throiught all notes in toxnotes for casenumber = tp.casenumber   
   > and bundled them into one display   
      
   You mean concatenate them to a single value? That can be achieved by   
   using FOR XML PATH(''), but it is difficult to give you a query, because   
   I don't know what output more exactly you are looking for.   
      
   > full join UHCF hos on hos.UHCFNumber = tp.CallerSiteCode   
   > full join Codevalue cv_pa on cv_pa.CodeID = tp.patageunit   
   > full join CodeValue cv_ct  on cv_ct.CodeID = tp.calltype   
   > full join CodeValue cv_mo on cv_mo.CodeID = te.MedicalOutcome   
   > full join CodeValue cv_cs on cv_cs.CodeID = tp.CallerSite   
   > full join CodeValue cv_pt on cv_pt.CodeID = tp.PatGender   
   > full join CodeValue cv_cr on cv_cr.CodeID = tp.CallerRelToPat   
   > full join CodeValue cv_er on cv_er.CodeID = tp.ExpReason   
   > full join  CodeValue cv_es on cv_es.CodeID = tp.ExpSite   
   > full join CodeValue cv_ms on cv_ms.CodeID = te.ManagementSite   
      
   I don't think this is right. FULL JOIN is something you don't use very   
   often. Probably you mean a LEFT JOIN for the columns in ToxPat which are   
   nullable.   
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
      
   --- 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