Databases for Windows  /   Database Blog  /   Organizer Advantage, Handy Library, SQL Tutor  /   SQL Select   /  SQL Tutor, Select DISTINCT
28/05/2024

SQL SELECT DISTINCT statement


The SELECT statement with Distinct

The SELECT DISTINCT statement is used to return only distinct values, all the duplicate rows are removed from the result.

SELECT Distinct syntax

SELECT DISTINCT columnname1, columnname2, ... FROM table_name;

SELECT DISTINCT columnname1 FROM table_name;

SELECT Distinct examples

SELECT DISTINCT title, author FROM library;

SELECT DISTINCT title FROM library;

Copyright © 2024 · All Rights Reserved · PrimaSoft PC