MySql – use of ALIAS for multiple columns

I saw the following code:

SELECT 
    u.ID, u.username, u.active, u.email, u.admin, u.banned, 
    u.name AS groupmemberships 
FROM users u 
WHERE u.ID={$uid}

and was wondering where the official documentation about aliasing multiple columns was. W3schools (not the best source) as the only place where I found “documentation” in the following way:

SELECT column_name(s) FROM table_name AS alias_name;

http://www.w3schools.com/sql/sql_alias.asp

I would appreciate a link to official documentation so I can look it over.

Answer

You can’t use the same alias for multiple columns, but you can concatenate values and give the result an alias:

SELECT 
  u.ID, u.username, u.active, u.email, u.admin, u.banned, 
  u.name + u.username AS groupmemberships 
FROM users u 

If this is what you want, then check here for how to deal with null values.