Hi all I have mysql query that I wish to display a random result of 60 rows without any duplicates E.g. the rows are A B B C I wish to see a result of C A B Do use concatenate here if so where SELECT DISTINCT * FROM TABLE WHERE X <> 'null' AND ORDER BY RAND() LIMIT 60
but i seen to get duplicate rows when processing this query i have looked at the data it seem to be idenetical on the output
The query should give an error: SELECT DISTINCT * FROM TABLE WHERE X <> 'null' AND ORDER BY RAND() LIMIT 60 Get rid of that 'AND' and see what happens. Anyway, doing a DISTINCT on all fields in the table, means you'll only get rid of rows that are identical in all field values. If you want to eliminate duplicate values of one or some of the fields present in the table, you'll have to name them explicitly in the SELECT (ie. SELECT DISTINCT field1, field2 FROM...)