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.
如何显示表格的所有内容而不重复?
例子:
Table 1 ______________________ | ID | VALUE | | 0 | A | | 1 | A | | 2 | B | | 3 | C |
预期输出:
A B C
关于什么
SELECT DISTINCT VALUE FROM table
或使用带有列GROUP BY的语句VALUE
GROUP BY
VALUE
没有任何重复的行。您只能将 distinct 关键字与值一起使用,就像 SELECT DISTINCT VALUE FROM XYZ; 您可以使用 group by 一样
SELECT DISTINCT VALUE FROM XYZ;
SELECT VALUE FROM XYZ GROUP BY VALUE;
但这是胡说八道。一个好的开发者不会使用它。