segunda-feira, 17 de maio de 2010

ORACLE SQL concatenation operator

A concatenation operator:
• Links columns or character strings to other columns
• Is represented by two vertical bars (||)

Create a query to display all the data from EMPLOYEES table.
Separate each column output by a comma.
Name the column title THE_OUTPUT.

SELECT
employee_id ||', '|| first_name ||', '|| last_name ||', '|| email ||', '|| phone_number ||', '|| hire_date ||', ' || job_id ||', '|| salary ||', '|| commission_pct ||', '|| manager_id ||', '|| department_id as "The Output"
FROM employees;