[snip]
I have one table with about 1000 hotels and name or the city they belong.
I want to run a query to get one row for every city only, to put it in a
pull down menu in the search form.
How is that?
[/snip]

SELECT DISTINCT city
FROM tblFOO

So if you have this table;

+-------------------+------------------------+
| City              |  Hotel                |
+-------------------+------------------------+
| Houston        | Hotel A              |
| Houston        | Hotel B              |
| Houston        | Hotel C              |
| San Antonio  | Hotel A              |
| Dallas           | Hotel A              |
| Detroit           | Hotel A              |
| Detroit           | Hotel B              |
+-------------------+------------------------+

The query will return;

+-------------------+
| City              | 
+-------------------+
| Houston        |
| San Antonio  |
| Dallas           |
| Detroit           |
+-------------------+

Hope this helps!

Jay Blanchard


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to