If someone can help me come up with a better way to do this, I'd appreciate it. I'm trying to get the DISTINCT city names, but I'd also like to get the number of meetings for each city or state. I could run a separate query for the count, but I could have potentially thousands of cities. My fear is that performance will take a serious hit.
Here are the details:
-mid (meeting id)
$bookmark_list = mysql_query("select DISTINCT m.city_id, c.city_id, c.state, c.city from calendar_meetings as m left join calendar_cities as c on m.city_id = c.city_id where m.meeting_date > (CURDATE() - INTERVAL 1 DAY) order by c.state, c.city");
I'm using MySQL5. I thought of maybe a nested select.
CrimsonDryad Web Design Services
Web Design, Custom Software Development