How do we use the DISTINCT statement? What is its use?

Asked: Apr 14, 2023

The DISTINCT keyword is used to ensure that the fetched value always has unique values. It does not allow to have duplicate values. The DISTINCT keyword is used with the SELECT statement and retrieves different values from the table's column. We can use it with the help of the following syntax:

  1. SELECT DISTINCT column_lists FROM table_name WHERE [condition];

Suppose we have a table 'customer' containing eight records in which the name column has some duplicate values.

Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!