var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
PHP/MySQL and Distinct
I've got a mysql table that may have duplicate field entries for the field "name". I'd like to list all these entries, but not list any duplicates.
Now I can do that with distinct, if I use:
But then I can't access any of the other information in the table. Can someone tell me how to use distinct in conjunction with using * to select all the fields for listing?
SELECT DISTINCT(name) FROM table
I hope that made sense.
I've found that I can do DISTINCT(name), age, location
But is there a way to do DISTINCT(name), * ?
try something like:
SELECT DISTINCT(t.name), t.* FROM table t;
Ah, so simple. Thank you t3r0.