Hi @Christopher Jack ,
If you have only one row of result, you could try with dynamic way like below:
declare @sql nvarchar(max)
set @sql= 'select MerchantIdentifier as '
+ case when (select salesoffice from yourtable) = '''Pia''' then 'PiaJewlerry' else
'''Merchant Identifier''' end + ' from yourtable'
EXECUTE sp_executesql @sql
If you have more than one row, you could not alias the column name in that way as mentioned by other experts.
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.