2
我希望选择一个用户参与的消息的表中的所有对话这个查询的工作为:MySQL的ID为等于列别名
select distinct message_conversationID from messages where message_userID = 2
不过,我当时想反过来提取物给出外键message_conversationID的所有会话标题(来自另一个表)。我尝试这样做:
select conversation_titles from conversations having conversation_id =
(select distinct message_conversationID as temp from messages where message_userID = 2)
但是,看来我无法验证其ID与多行数据等于。我还有什么可以在别名列中提取所有带有ID的标题?