Skip to content
Loading
Select case with another select after then
  • Thank you so much mr Patel you pointed in the right direction.
    but let me add up to the previous idea.
    I want to concatenate firstname and lastname when IsEmployee equal to 1 and not concatenate them when IsEmployee not equal to 1
     
    I tried 
    1. Select Case IsEmployee  
    2.  when 1  
    3. firstname + ' ' + Lastname  
    4. else  
    5. firstname, lastname  
    6. end   
    7. from tblemployee 
     
    +2
  • Pankajkumar Patel
    Hi Schleid Alex,
     
    As following you can use Select case with another select after then:
    1. select case isEmployee   
    2.     when 1   
    3.         then firstname + ' ' + lastname   
    4.         else firstname   
    5.     end as EmployeeName   
    6. from tblEmployee  
    Hope, this will help you!
    +4