I can write something like this with LINQ:
var selection = from person in personList
let initials = person.FirstName[0] + person.LastName[0]
select initials;
Can I do something similar with SQL, like maybe:
SELECT @Initials
FROM [Person]
SET @Initials = SUBSTRING (Person.FirstName, 1, 1) + SUBSTRING (Person.LastName, 1, 1)
Probably not but maybe there is a trick?
I need to have a precalculated variable for further use in a complex WHERE clause to avoid extreme complexity and code repetition.