AFAIK, there is no SQL method in any large DBMS product.
To name PIVOT columns in Oracle, for name in.. as seems like the best option.
In addition, he moves on to dynamic SQL.
Original answer below
To name a query column, the ANSI standard simply adds a new name after the column (derived or base) added by "AS":
SELECT id, field1, field2 * qty FROM foo
All columns renamed below:
SELECT id AS RenamedID, field1 AS Col1, field2 * qty AS ExtendedTotal FROM foo
This standard works in almost all major database systems. There are some vendor-specific options, such as SQL Server, that allow the equal sign
SELECT RenamedID=id FROM foo
And most DBMSs allow you to exclude the keyword "AS"
SELECT id RenamedID FROM foo
source share