Header Ads

Header ADS

Duplicate Rows in SQL

Duplicate Rows


Topic Introduction: In this tutorial, we will see how to find out unique data or information by SQL query. Oracle has two default functions for showing a unique row. I have given Examples and Descriptions below to clarify this topic.

By default Oracle SQL query display all row, including duplicate rows. when we use the DISTINCT or UNIQUE function it avoids duplicate rows and displays the unique row.

Example without any unique function

SELECT job_id
FROM employees;


without distinct the 1st query return 108 rows, where duplicate row are also included.

Example with unique function

SELECT distinct job_id
FROM employees;


with distinct the 2nd query return 19 row, where duplicate row not included.

No comments

Theme images by Deejpilot. Powered by Blogger.