If I want to compute a column and use the result in more than 1 column, how do I do this without making the computing twice?
Example:
SELECT LOWER(SUBSTRING([NAME], 4, 100)) + '@somedomain.com' as EMail
,hashbytes('SHA1', LOWER(SUBSTRING([NAME], 4, 100)) + '@somedomain.com') as HashedEmail
FROM sometable
How do I avoid writing this twice without using more than one select?