SQL Distinct Keyword, SQL Tutorial, Global Guide Line Technology.
Forum | Blog |


Basic SQL Guide.           
SQL Introduction.               
 What is Table?                  
 SQL Create Table.            
 SQL Insert Statement.      
 SQL Select Keyword.        
 SQL Order by clause.        
 SQL Count Statement.      
 SQL Group By Clause.      
 SQL Having Clause.          
 SQL Alias Tables.             
 SQL Join Tables.              
 SQL Outer Join.               
 SQL Update Statement.   
 SQL Delete Statement.    
 SQL Distinct Keyword.
 SQL Where Keyword.       
 SQL And Or Keyword.      
 SQL In Keyword.              
 SQL Between Keyword.   
 SQL Like Keyword.          
 SQL Functions.                
 SQL Concatenate.           
 SQL Substrings.               
 SQL Trim Function.         
 SQL Constraints.              
 SQL Primary Key.            
 SQL Foreign Key.            
 SQL Create Views.           
 SQL Create Index.           
 SQL Alter Table.             
 SQL Drop Table.             
 SQL Truncate Table.      
 SQL Summary.                

SQL Tutorial >> SQL Distinct Keyword.

     Back             Next     

The SELECT keyword allows us to take hold of all information from a column or columns on a table in database. This, ofcourse, necessarily mean that there will be redundancies. No in SQL Tutorial we will learnt that what if we only want to select each DISTINCT element in table? This is easy to accomplish in SQL. All we need to do is to add SQL DISTINCT after SELECT keyword. The syntax for SQL Distinct Keyword is as follows:

Syntax for SQL Distinct Keyword

SELECT DISTINCT "column_name"
FROM "table_name"

For example, to select all distinct First Names in Table Employees_Salary

Table Employees_Salary
FirstName Month Salary
Austin January 1000$
Austin February 1100$
Creston February 1100$
Kate February 1100$
Angela February 1000$
Bobbi February 1200$
Cute February 1300$

Example of SQL Distinct Keyword

SELECT DISTINCT FirstName FROM Employees_Salary

Result of SQL Distinct Keyword example

     Back             Next     

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright 2005 -  2022 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 325 visitors are online now