SQL Select Distinct

SQL Select Distinct

The SELECT DISTINCT statement is used in SQL to retrieve unique values from a specified column or a combination of columns in a table. It eliminates duplicate rows and returns only the distinct values.

Here’s the basic syntax of the SELECT DISTINCT statement:

sql
SELECT DISTINCT column1, column2, ...
FROM table_name;

You replace column1, column2, ... with the names of the columns you want to retrieve unique values from, and table_name with the name of the table you want to query.

For example, if you have a table called employees with columns name, department, and salary, and you want to retrieve the distinct values from the department column, you would use the following query:

sql
SELECT DISTINCT department
FROM employees;

This query will return a result set with only the unique values found in the department column of the employees table.

Note that the SELECT DISTINCT statement applies the distinctness to the entire row, so if you include multiple columns in the SELECT DISTINCT clause, the combination of values in those columns will be considered for distinctness.

Leave a Comment

Your email address will not be published. Required fields are marked *

GLOTRU Footer
Popular Features
Popular Services/

Website Development & Design

App Development & Design

Graphic Design

Digital Marketing

SEO (Search Engine Optimization)

SMM (Social Media Marketing)

Cyber Security

Company

GLOTRU Founder & CEO : __Azam

Registared : Trade,MSME,etc

Board of Director

Team

About Us

Contact Us

Privacy Policy

Return & Refund Policy

Abuse Policy

Copyright Policy

Cookie Policy

Terms & Conditions

Universal Terms of Service

Disclaimer

Legal

Sponsorships

Investor

Press Releases

Our Investments

Brands

Newsroom

Business

...

_

Digital Millennium Copyright Act
DMCA.com Protection Status

_

Content similarity detection
Protected by Copyscape

_

***ANTI-PIRACY WARNING***

...................................................................................

Follow Us :

...................................................................................

SECURE SERVER : [Legal] [Privacy Policy] [Universal Terms of Service] [Do not sell my personal information]

SITE HOSTED : GLOTRU SECURE SERVER Asian Data Centre [You can host your site][Click Here]

SSL : Server Type : [Cloudflare] Certificate Issued By : [Let's Encrypt] Signature Algorithm : [ECDSA with SHA-384]

SITE BUILD SOFTWARE : Content Management System (CMS) Softwere

_

_

_