Syntax

SQL Remove Duplicates Syntax

In SQL, remove duplicates: returns only unique values — SELECT DISTINCT country FROM users;

Quick Answer

Syntax
SELECT DISTINCT country FROM users;
SQLSyntax

Remove Duplicates

Code example
SELECT DISTINCT country FROM users;

Returns only unique values.

Learn More

How to remove duplicates in SQL

  1. Open your SQL file or editor.
  2. Copy the example, then replace its sample names and values for your code.

SQL Remove Duplicates Syntax

Use SELECT DISTINCT country FROM users;.

Related Syntax References

Frequently asked questions

What is the SQL syntax for remove duplicates?

Use this pattern: SELECT DISTINCT country FROM users;

Can I copy this SQL code example?

Yes. Use Copy code and adapt the example to your program.

Is this SQL syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify