Page 1 of 1

not load duplicate criteria from mysql

Posted: Sat Jun 28, 2008 6:36 am
by jim_php
hello i have one mysql and i wan to load some records with where.....
but in some records has duplicate values

example
select all records form some database ...

results ........
id = 1, first_name = jim, mobile = 123456789,
id = 2, first_name = george, mobile = 123456789,


i dont want load the second record because has the same mobile...

the records is too many...
and the duplicates are also many....

any idea ?

Re: not load duplicate criteria from mysql

Posted: Sat Jun 28, 2008 9:30 am
by Bill H
SELECT FROM (blah, blah) LIMIT 1

Re: not load duplicate criteria from mysql

Posted: Sat Jun 28, 2008 1:12 pm
by jayshields
Use the GROUP BY and/or DISTINCT clause.

Re: not load duplicate criteria from mysql

Posted: Sat Jun 28, 2008 1:57 pm
by califdon
If you're still having a problem, please show us your exact SQL statement, and which field is the one that has duplicate values.