Previous |
Next
What is SQL DISTINCT?The SQL DISTINCT keyword specifies that only distinct / non-duplicate results are to be returned. DISTINCT can apply to single columns or to multiple columns. Why Use SQL DISTINCT?The DISTINCT keyword can help to understand information. For example, a query containing DISTINCT could return a non-duplicated list of cities where a company does business. How To Use SQL DISTINCTSQL DISTINCT is used as follows. SQL DISTINCT Syntax
The word DISTINCT can be placed in front of a single column name or a number of column names. When in front of multiple column names, a distinct combination is returned. SQL DISTINCT Example The following example a DISTINCT list of region_nbr referenced in the branch table is returned. Here are the contents of the table:
Table: BRANCH
This SQL Statement with DISTINCT is executed:
Here is the result.
|
SQL OVERVIEW
SQL BASICS
SQL SELECT
SQL WHERE
SQL INSERT
SQL UPDATE
SQL DELETE
SQL ADMINISTRATION
SQL CREATE DATABASE
SQL DROP DATABASE
SQL CREATE TABLE
SQL ALTER TABLE
SQL DROP TABLE
SQL CREATE INDEX
SQL DROP INDEX
SQL ADD FOREIGN KEY
SQL DROP FOREIGN KEY
SQL CREATE VIEW
SQL DROP VIEW
SQL ADVANCED
SQL CONCAT
SQL SUBSTRING
SQL TRIM
SQL AND & OR
SQL IN
SQL BETWEEN
SQL LIKE
SQL DISTINCT
SQL GROUP BY
SQL AGGREGATE
SQL HAVING
SQL ORDER BY
SQL JOIN
SQL OUTER JOIN
SQL SYNTAX
| HOME | SQL OVERVIEW | SQL BASICS | SQL ADMINISTRATION | SQL ADVANCED | SQL SYNTAX |
| Copyright© 1999-2006, First Place Software, Inc. |






