Maryam Naz2,959 Points
how to combine "AS" statement so I wont have to re-type AS each time?
Solution 1 below does the job but isn't elegant. Anyway I can make Solution 2 work ( that is to only state "AS" once?
Solution 1: works, but I have to type "AS twice"
SELECT LOWER(title) AS lowercase_title, UPPER(author) AS uppercase_author FROM books;
Solution 2: how to combine all the "AS" together, to avoid retyping "AS", something example below?
SELECT LOWER(title) , UPPER(author) AS (lowercase_title, uppercase_author) FROM books;
Steven Parker182,024 Points
The first example is a correct solution. The second one is not proper SQL syntax, and aliases must be applied individually.
A common observation about SQL is that it tends to be a bit verbose and has very few "shortcut" variations in the syntax.