SELECT event.event_name, restaurants.res_name
FROM event_choices
INNER JOIN restaurants
ON event_choices.res_id = restaurants.res_id
INNER JOIN event
ON event_choices.event_id = event.event_id
我正在尝试根据event_id
此查询获取最后插入的记录,从而带回所有记录。
类似于mysql_insert_id()
会做什么。
是否可以修改查询以仅返回最后插入的记录?
我的数据看起来像这样我需要返回最后一个event_id
及其匹配res_id
event_id | res_id
116 | 1
116 | 2