MySQL - Selecting Unique Entries
| From: | Tom Churm | Date: | Fri, 28 Sep 2001 12:29:33 +0000 |
| Subject: | MySQL - Selecting Unique Entries | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-69166@lists.php.net to get a copy of this message | ||
hi,
i need to weed out all duplicate entries in a select statement.
i've done research and have discovered 2 different possible solutions
for this. i'd like to know which one is better to use?
after trying them out on MySQL, Select Distinct appears to be highly
unreliable. i get somewhat better results when i use Select Distinct
trim(seminar_name), but this Group By solution seems to work better:
SELECT seminar_name
FROM student_table GROUP BY seminar_name
SELECT DISTINCT seminar_name
FROM student_table
thanks for the advice,
tom