Home
Manage Your Code
Snippet: JOIN with CASE (SQL)
Title: JOIN with CASE Language: SQL
Description: JOIN with CASE Views: 2109
Author: mazeman mazeman Date Added: 11/6/2007
Copy Code  
JOIN  dbSecurity.dbo.AccountInstSecurityRole s 
  ON s.InstitutionID =  
     CASE 
       WHEN (RecordCount) <= 1
         THEN v.ParentInstitutionID
       ELSE v.InstitutionID
     END