SQL – Alias (As)

Spread the love

Alias – it refers that a temporarily name is specified of a table or a column.

It is a good practice, when writing a query, it makes query readable, also it helps to define a logical name for the output of query and within a query.

Syntax –

Select column1 as Product_name
From Table as Product_Table

Brand Table

S.NOPRODUCTMONTHYEAR
1NIKEDEC2016
2REEBOKJAN2014
3FILAFEB2017
4PUMAJAN2015
5REEBOKFEB2016
6FILAMAR2015


Select Product ,
Product as DupOfProduct
from Brand as B

B Table

PRODUCTDupOfProduct
NIKENIKE
REEBOKREEBOK
FILAFILA
PUMAPUMA
REEBOKREEBOK
FILAFILA