View Full Version : Echo distinct MySQL columns values?
01-31-2007, 07:40 PM
Any way to echo distinct MySQL column values? I can only see COUNT(DISTINCT column). Example:
Would echo as:
01-31-2007, 09:07 PM
remove the count.
select distinct columnname from yourtablename
note that will only work for single columns, DISTINCT is not a function and works across all columns in a row.
for instance if you had
color1 and color2 as your columns and had the following values:
all of those rows are distinct from one another so
select distinct color1, color2 from yourtablename
would return all of those rows.
02-01-2007, 02:57 AM
Thanks guelphdad........The code is working.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.