Page 1 of 1

MySQL "unique"-type command?

Posted: Mon Aug 30, 2004 1:06 pm
by voltrader
I have a table of states, cities contained there-in, and associated zips.

I'd like to populate a listbox with a list of cities contained within a particular state, however, I receive quite a few duplicate results, because of the many zips per city.

Is there a MySQL command that will ignore a city, if that city has already been retrieved?

I've got to pick up the O'Reilly reference mentioned earlier :!:

Posted: Mon Aug 30, 2004 1:24 pm
by markl999

Posted: Mon Aug 30, 2004 1:24 pm
by Weirdan
select distinct city from cities where state = 'NJ'

Posted: Mon Aug 30, 2004 1:29 pm
by voltrader
Thanks folks