Skip to content
Advertisement

SQL Alias an entire query

I have a query that I am trying to assign an alias to so that I can take a primary key that I made by concatenating some of the columns together against two other queries. The code goes like the below.

Can I assign an alias to this query? Or would it be best to throw this into a Temp Table along with my other two queries and then Join across the three tables?

Advertisement

Answer

Yes, as other people suggested, you could do CTE, for example

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement