Can we alias multiple columns in a single query?


#1

Question

Can we alias multiple columns in a single query?

Answer

Yes, you can alias multiple columns at a time in the same query. You can even alias multiple columns to the same alias if needed, and no error will be thrown.

Furthermore, when aliasing, it is not entirely necessary to include quotes around the new alias, but it can be good practice to include them

Example

SELECT name AS 'title', year AS 'release_year'
FROM movies;