Alias Column Examples

Example 1

Select first_name ||' '|| last_name AS full_name, code AS id From customers;

Example 2

Select o1.offer_id, o1.amount, (
     Select count(*) From offers o2
     Where o1.amount = o2.amount) -1
            As alias_example
  From offers o1
Where o1.offer_id=1;


Example 3

Select s.id, s.name, s.salary,
            decode (s.salary, 1500, 'Junior',
                                           2500, 'Senior',
                                           5000,'Team Leader',
                                           8000,'Manager'
                           ) As alias_example
  From emp_salaries s
Where s.department='IT'
Order By s.salary