Year(生日),得到年
Month(生日),得到月
Day(生日),得到日
前提是这个生日是一个日期型字段。

 

查询和学号为108的同学同年出生的所有学生的Sno、Sname和Sbirthday列。

select Sno,Sname,Sbirthday from Student where Sbirthday=(select Sbirthday from Student where Sno='108') #年月日全部匹配

select Sno,Sname,Sbirthday from Student where Year(Sbirthday)=(select Year(Sbirthday) from Student where Sno='108') #只匹配年

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2021-07-03
  • 2022-02-20
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案