Tuesday, December 2, 2014

Using Literal Character Strings and Duplicate Rows

Using Literal Character Strings

SELECT first_name ||' is a '||job_id      AS "Employee Details"
FROM   employees;
EMPLOYEES DETAILS
John is a C_CEO
Leonardo is a F_CEO
Duplicate Rows

The default display of queries is all rows, including duplicate rows. By using Distinct you can eliminate repeated rows
SELECT department_id FROM   employees;
DEPARTMENT_ID
20
20

SELECT DISTINCT department_id FROM   employees;
DEPARTMENT_ID
20
10






No comments:

Post a Comment