Using Column Aliases

Using Column Aliases

When you run a query for displaying the result of a query, a column aliases is useful rename that columns with calculations, so you can change easily column header using a column aliases. Always define a column alias after the column name, by default column alias header appear in uppercase, if you use space or special characters or it’s case-sensitive so alias close in double quotation(” “) marks.

Click here to read about Single Row Functions

We have three ways to define column aliases

1. Using below query we can define column alias.

SQL> select first_name name from ocp;

2. You can also define alias name with “as” keyword. Use below query for example.

SQL> select salary as sal from ocp;

3. If you want to define two word name, then use alias name in double quot “”, below query will show you Annual Salary as name of salary column.

SQL> select salary*12 "Annual Salary" from ocp;

You Can subscribe my YouTube channel

Share this

1 thought on “Using Column Aliases”

Leave a Comment