# MySQL Table Join (Help with Query)

**URL:** <https://forum.kirupa.com/t/mysql-table-join-help-with-query/302432>\
**Category:** programming\
**Created:** [December 30, 2009, 2:33pm UTC](https://forum.kirupa.com/t/mysql-table-join-help-with-query/302432 "2009-12-30T14:33:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispas](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wispas](https://forum.kirupa.com/u/wispas)\
**Post date:** [December 30, 2009, 2:33pm UTC](https://forum.kirupa.com/t/mysql-table-join-help-with-query/302432/1 "2009-12-30T14:33:56Z")

</div>

**Database name:**  
Citybreak

**CITY TABLE**  
city\_id, city\_name, city\_desc, hotel\_1, hotel\_2, hotel\_3)

**HOTEL TABLE**  
hotel\_id, hotel\_name, hotel\_desc

so i have inserted a **hotel\_id** into hotel\_1, hotel\_2 and hotel\_3 as this will allow me to choose which hotels i want to display for that city.

now i want to write a sql query to say:

if your displaying a city it will also display the 3 hotels we defined with the hotel\_1, hotel\_2 and hotel\_3 fields in the city table.

Any Ideas?

**I have tried this query so far:**  
SELECT city.city\_id, city.city\_name, hotel.hotel\_name FROM city, hotel INNER JOIN hotel WHERE hotel.hotel\_id = city.city\_hotel\_1

This gives me one hotel, but i want to show all 3.
