Thursday, January 28, 2016

SQL SELECT DISTINCT AND GROUP BY: Select Distinct Values in SQL and Group By

Select is used to display all columns from a table. This includes records with redundancies. So if you want to display records without redundancies, in short without duplicates, you use the keyword DISTINCT or GROUP BY.

Syntax

select DISTINCT column_name from table_name
select * from table_name GROUP BY column_name

Table
CUSTOMER















SQL Code
select DISTINCT customer_name,customer_address from customer
select customer_name,customer_address from customer GROUP BY customer_name

Output

SQL SELECT DISTINCT AND GROUP BY: Select Distinct Values in SQL and Group By

SQL SELECT DISTINCT AND GROUP BY: Select Distinct Values in SQL and Group By Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment