Is 'AS' creating a temporary alias or a true new column? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is 'AS' creating a temporary alias or a true new column?

For exemple with the folowing code : SELECT CONCAT(FirstName,', ', City) AS new_column FROM customers; Will the column "new_column" be created or is it a kind of alias which disappear at the end of the request?

5th Mar 2017, 4:56 PM
Geoffrey L
Geoffrey L - avatar
3 Answers
+ 11
Correction: it is ALTER TABLE and so on.
5th Mar 2017, 5:14 PM
Tashi N
Tashi N - avatar
+ 10
AS is temporary. For a new column use ALTER tablename ADD columnname type.
5th Mar 2017, 5:12 PM
Tashi N
Tashi N - avatar
+ 1
Oh yeah, thanks!
5th Mar 2017, 5:13 PM
Geoffrey L
Geoffrey L - avatar