I'm running the following selection and I don't recive any results. I should have results, but I'm new to MySql and I don't know if I'm doing something unsupported by MySql.
I'm trying to bring the name of a city from a table with the city code taht is a foreing key in another table.
The selection is:
SELECT h.name,c.name FROM hotel h, city c WHERE h.cityID = 15 and c.id = h.cityID
I made other selections and it works badly. Am I doing something wrong?
MattF wrote:That looks like some very complicated SQL for a beginner it doesn't look much like mySQL to me. I suggest doing several queries to get your results.
No it is more robut to do joins like the one he proposed than to do multipal queries.