How to select and display records from MySQL table using the DISTINCT keyword for unique data.
This is for removing duplicated results in order to gain unique listings from
your database table using the DISTINCT keyword in your
MySQL select statement .
For example if you ran this:
Select Cars FROM Cars_Listing ======== Results ======= BMW BMW HONDA BENZ BENZ BMW FORD FORD =======================
Notice how there is more then one BMW.
Here is how to clean up that result by using the DISTINCT keyword in your
MySQL select statement
Select DISTINCT Cars FROM Cars_Listing ======== Results ======= BMW HONDA BENZ FORD =======================



(32 votes, average: 3.34 out of 5)
hahaha… I did stupid thing before I read this article. Thank you so much, I did not realize this damn good function.
It really annoys me when people use ‘then’ instead of ‘than’. For example, ‘Notice how there is more THAN one BMW.’.
Halleluyah !
I need it, thx. Good bye.
I need a combined query that filters on multiple fields and then removes duplicates for one field
for instance
id name sports
1 john soccer
2 john tennis
3 jane tennis
mysql_query(“SELECT * FROM table WHERE `sports` = ‘soccer’ “);
mysql_query(“SELECT * FROM table WHERE `sports` = ‘tennis’ “);
now I found john twice, but I need him only once
any suggestions?
Thanks for tutorials….