Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle Aliases

In Oracle Aliases are usually used to give a temporary name to table, or a column. Using aliases you can make column names more readable.

Oracle ALIASES COLUMN Syntax

To give a temporary name to table, or a column., use the following syntax:

Syntax

SELECT col_name AS alias_name
FROM tablename;

Oracle ALIASES COLUMN example

The following Oracle, creates two aliases, one for the "custID" column and one for the "custName" column:

Example

SELECT firstName as Name, lastName AS LastName
FROM tblCustomerLoan;

OR

SELECT CONCAT(firstName,' ',lastName) AS Name, address
FROM tblCustomerLoan;

Note:

In the above example, we are creating two aliases, one for the "custID" column and one for the "custName" column.

Oracle ALIASES TABLE Syntax

To give a temporary name to table, or a column., use the following syntax:

Syntax

SELECT col1, col2,...
FROM tablename AS alias_name;

Oracle ALIASES TABLE example

The following Oracle, creates two aliases, one for the "tblCustomerLoan" table and one for the "tblCustomer" table:

Example

SELECT B.firstName, B.lastName, A.panNo,A.aadharNo
FROM tblCustomerLoan AS A, tblCustomer B
WHERE B.firstName = 'Dilip' AND A.custId = B.custId;