Tom: if you need to weed out duplicates you may try knowing which entries
duplicate themselves and how many times they are duplicated, why don't you

SELECT seminar_name COUNT(*)
FROM student_table GROUP BY seminar_name

This will return the seminar_name field plus a COUNT field that will display
the number of times the first field was found.

If you want the seminar_name to be unique and not be repeated then you
should get "1" in every row of the COUNT field, the rows that get more than
"1" are repeated and this way you will know which ones to eliminate.


Iván Milanez

"Tom Churm" <[EMAIL PROTECTED]> wrote in 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

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to