我正在尝试获取事件的城市名称和用户居住地的城市名称。它们都有一个邮政编码,对应于表中的 city_name cities
。
到目前为止我的查询:
SELECT
meetups.meetup_name,
meetups.meetup_text,
users.username,
cities.city_name
FROM
meetups, users, cities
WHERE
meetups.url_meetup = ? and users.id = meetups.author_id and cities.postalcode = meetups.postalcode
我仍然需要得到用户的城市名称。
我的表格如下所示:
meetups =>
id
meetup_url
meetup_name
meetup_text
author_id
postalcode
users =>
id
username
postalcode
cities =>
postalcode
city_name