Syntax: SELECT DISTINCT column1, column2 FROM table_name;
SQL & Relational Databases
SQL Tutorial
SQL Database
Advertisement
Google AdSense Slot (LEADERBOARD)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Unique Values
7 min read
•
Chapter 5 of 20
SQL SELECT DISTINCT
The SELECT DISTINCT statement is used to return only distinct (different) values, eliminating duplicate rows.
Example
<!DOCTYPE html>
<html>
<body style="font-family:monospace;padding:20px;">
<pre>SELECT DISTINCT Country FROM Customers;</pre>
</body>
</html>
Try it Yourself >>
Opens live sandboxed code editor
Advertisement
Google AdSense Slot (IN-ARTICLE)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Community Q&A & Discussion
Verified
No questions yet. Be the first to start the discussion!