Do aliases need to be enclosed in quotes?


#1

Question

Do aliases need to be enclosed in quotes?

Answer

Quotes are not required for aliases unless the name contains whitespace. For example, the following query is fine:

SELECT name AS Movie
FROM tbl;

but quotes would be needed here:

SELECT name AS 'Movie Title'
FROM tbl;