DISTINCT作用很简单就是去除重复行的数据。

具体看下面列子

表A数据[两条 nami 99]

nameA   scoreA  

robin     98

nami     99

saber    98

luffy     99

nami   99

saber   90

---------------------

通过以下语句

SELECT DISTINCT nameA,scoreA FROM A;

nameA   scoreA  

robin     98

nami     99

saber    98

luffy     99

saber   90

----------------------

通过Distinct去除了重复的nami 99数据只显示了一条该数据。

 

参考资料:http://www.w3school.com.cn/sql/sql_func_count_distinct.asp

相关文章:

  • 2021-07-06
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-13
  • 2021-11-29
  • 2021-09-10
  • 2021-11-19
  • 2021-11-19
  • 2021-04-05
相关资源
相似解决方案