1. 查询所有记录 和 查询 非重复记录

语法:
SELECT    [ALL | DISTINCT ]
All:返回所有记录
Distinct:返回非重复记录
针对获得的记录内的字段生效。
 
2. 案例:
(1)看下面图,我们发现查询到是很多重复的,如下:
 
MySQL(15):Select-distinct(返回非重复的记录)
 
 
(2)使用Select—distinct,如下:
MySQL(15):Select-distinct(返回非重复的记录)
 
 
 
 
 
(3)select * from /  select distinct * from
MySQL(15):Select-distinct(返回非重复的记录)
 
 
 
(4)select days,begin_date from teacher_class  /  select distinct days, begin_date from teacher_class
MySQL(15):Select-distinct(返回非重复的记录)

相关文章:

  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2021-11-25
  • 2021-09-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-03-04
  • 2022-01-02
  • 2022-02-25
相关资源
相似解决方案