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 [type], ITEM_ID FROM Item ORDER BY [type]
SELECT DISTINCT [type], ITEM_ID FROM Item ORDER BY ID
看来您不能对 distinct 和 order by 子句使用相同的字段