How to use an alias for a column

Use the AS keyword to specify an alias

      SELECT productID, productName AS name, listPrice AS price 
      FROM products 
      WHERE listPrice < 450 
      ORDER BY listPrice;
      
alias using AS image

Omit the AS keyword

      SELECT productID, productName name, listPrice price 
      FROM products
      WHERE listPrice < 450 
      ORDER BY listPrice;
      
alias not using AS image

Use quotes to include spaces

      SELECT productID AS "ID", productName AS "Product Name", listPrice AS "Price"
      FROM products 
      WHERE listPrice < 450 
      ORDER BY listPrice;
      
alias using quotes image

Description

Back