create alias in the select query with case statement

  • SELECT  [Module] as ModuleName =

      CASE  [Module]

             WHEN 'Soarian Clinicals-Classroom Instruction'        then            

    [Module]

             ELSE rtrim([Module])+'(Online Module)'

          END 

     FROM   [Module Name List SClinicals]

     

    SELECT  [Module] =

      CASE  [Module]

             WHEN 'Soarian Clinicals-Classroom Instruction'        then            

    [Module]

             ELSE rtrim([Module])+'(Online Module)'

          END  as ModuleName

     FROM   [Module Name List SClinicals]

     

    both are not working. Thx.

  • SELECT  CASE WHEN [Module] = 'Soarian Clinicals-Classroom Instruction'        then [Module]

             ELSE rtrim([Module])+'(Online Module)'

          END  as ModuleName

     FROM   [Module Name List SClinicals]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply