Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想清楚地选择我表的两个字段。
我这样做使用:
SELECT DISTINCT `from`, `to` FROM `messages` WHERE `from`='9129771472' // the condition is just an example, any number could be there
但是,问题在于,只有from和to被选中。我需要使用更多的列。
from
to
我确信那里有一个快速解决方案。我看过其他有关此的帖子,但到目前为止没有任何帮助。
不使用的原因是什么GROUP BY
GROUP BY
SELECT * FROM `messages` WHERE `from`='9129771472' GROUP BY `from`
或者
SELECT * FROM `messages` WHERE `from`='9129771472' GROUP BY `from`,`to`