我有两张表:
posts(id,user_id,event_id}
events(event_id,name,date]}我想做一个查询,检索特定user_id的所有事件名称,比如id数字2。
在伪代码中,假设
select all the event names from posts where user_id=2发布于 2011-02-11 08:27:15
尝试:
select events.name from posts, events
where posts.event_id = events.event_id and user_id = 2根据您希望没有匹配项的结果的显示方式,您需要有一些稍微不同的内容。
发布于 2011-02-11 08:27:57
使用(event_id) where user_id = 2
从事件中选择名称加入帖子
https://stackoverflow.com/questions/4964326
复制相似问题