What is SQL Distinct ?

Asked By 0 points N/A Posted on -
qa-featured

Hello,

I am new in SQL.

I want to know details about SQL Distinct?

SHARE
Best Answer by Goram Ian
Answered By 5 points N/A #160943

What is SQL Distinct ?

qa-featured

Hi,

The Distinct is used in SQL if you want to remove duplicates in any of your tables.

Say in a table named 'tab' there are two rows with the same entry.

Say 'Andy' and again 'Andy'. In this case you will use distinct to remove one of these.

The syntax is like:

  • Select Distinct columns.
  • From tables.
  • Where predicates.

Thanks.

Answered By 5 points N/A #160944

What is SQL Distinct ?

qa-featured

Hello Aksha,

1. SQL is Structure Query Language. SQL is a language that manipulate the database.

2. In SQL there are some types of commands like DDL commands, DML command, DTL commands etc.

3. In DDL commands means Data definition Language we can Create Table, Delete Table.

4. In DML commands means Data Manipulate Language. Using DML commands we can insert data into table, delete entry, update etc.

5. DCL Commands means Data Control language. Using these Commands we control the database.

Thanks, Regards,

Zafar Ali

Answered By 0 points N/A #160945

What is SQL Distinct ?

qa-featured

Hi Aksha Dave, 

First, let me introduce to you what SQL Distinct is all about. SQL is an acronym for Structured Query Language in which it is a standard relational query language used for interaction with databases. SQL defines many keywords in which it is divided into different categories.

SQL Distinct is a command used along with the SELECT keyword which retrieves only unique data entries depending on the column list that you have specified after it. The DISTINCT keyword is a command which removes the duplicates from the result set returned by your SELECT SQL statement.

Answered By 0 points N/A #160946

What is SQL Distinct ?

qa-featured

Hello Aksha,

SQL DISTINCT command used in conjunction with the word SELECT gets only unique entries depending on the list of column that you selected thereafter. Mainly it is used for:
 
1. Removal of the duplicate entries.
 
2. Using Select command along with Distinct will help you to retrieve both the same named entries if they are having different email or last name.
 
Thanks.
Answered By 0 points N/A #160947

What is SQL Distinct ?

qa-featured

A table may contain a lot of data in it; some columns will contain duplicate values.

The DISTINCT keyword can be used to return only unique values.

Look at Table Contact:

Individual Id

First Name

Last Name

1

Xavier

Smith

2

Jacobs

Simmons

3

O’Brain

Pattison

4

Jacobs

Smith

5

Xavier

Drew

SQL statement

SELECT DISTINCT(First Name) FROM Contact.

OUTPUT

First Name
Xavier
O’Brain
Jacobs

Thank You.

Best Answer
Best Answer
Answered By 60 points N/A #160948

What is SQL Distinct ?

qa-featured
Hi, Aksha Dave,
 
I have read your post and been interested with your problem. I have searched the internet for possible answers and took some links of the possible answers that you needed for your problem. Kindly check the link below:
Or else you can check the posts of other SQL users about SQL Distinct
Hope it helped you a lot with your problem.
 
Thanks and more powers.
 
Answered By 0 points N/A #160949

What is SQL Distinct ?

qa-featured

The SELECT keyword allows us to grab all information from a column (or columns) on a table. This, of course, necessarily mean that there will be redundancies. What if we only want to select each DISTINCT element? This is easy to accomplish in SQL. All we need to do is to add DISTINCT after SELECT. The syntax is as follows:

SELECT DISTINCT "column_name"
FROM "table_name"
 
Thank You.
 
Answered By 0 points N/A #160950

What is SQL Distinct ?

qa-featured

Hi Mr. Dave,

SQL Distinct it is a command where you specify what column or list you choose.

It illustrates to use the word DISTINCT to make it work. Example:

SELECT DISTINCT CITY

FROM User.

TABLE User.

NAMES CITY
JOHN cebu
Emily leyte

After executing distinct.

CITY
cebu
leyte

And to follow you may go to this website so you can understand it more.

Related Questions