Distinct Syntax for SELECT Query in Mysql

If you have same data on the database table and you want to avoid duplication in your query result then you can use distinct word in mysql query to avoid duplication.

Example Table : For your reference


table_name
Column_name1Column_name2Column_name3Column_name4
1TecharticlesSam
2MysqldatabaseSam
3JavacodingJam
4J2eecodingKam
5HibernatecodingJam

Table Name is : table_name


The table table_name contains four column data but the column_name4 has 2 sam and 2 Jam but i want  to avoid sam and Jam with single results.


Query : "SELECT  DISTINCT Column_name4 from table_name"


If you execute the above query then the duplicate data from Column_name4 will be filtered.

table_name
Column_name4
Sam
Jam
Kam

Comments

Popular posts from this blog

Five More Indian Languages - Google Translate

Connect To JioFi Device Without Knowing The Passwords Using WPS