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.
在我的表中,我有类别行。我想知道我有哪些类别,而不是查询所有类别。有没有办法让 SQL 查询只返回一个出现很多相同的事件?
是的,使用DISTINCT
DISTINCT
SELECT DISTINCT categoryName FROM category
使用SELECT DISTINCT。它只会返回每个值一次。