A table could hold duplicate rows. In such a case, to view only unique rows the distinct clause can be used. The DISTINCT clause allows removing duplicates from the result set. The DISTINCT clause can only be used with select statements.
The DISTINCT Clause cans through the values of the column/s specified only unique values from amongst them. Syntax :

SELECT DISTINCT ColumnName1,ColumnName2 from TableName;

The SELECT DISTINCT * SQL syntax scans through entire rows and eliminates rows that have exactly the same contents in each column. Syntax :

SELECT DISTINCT * from TableName;

Anuj Kumar

This is Anuj Kumar. I’m a professional web developer with 4+ year experience. I write blogs in my free time. I love to learn new technologies and share with others.
I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials.

Recommended Tutorials for you

Add comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Web Hosting with a FREE domain. On sale ₹99.00/mo

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.