时间函数:

1.curdate() --- 当前系统日期

调取:

select curdate()

2.curtime() --- 当前系统时间

调取:

select curtime()

3.now() --- 当前日期时间

调取:

select now()

4.year() --- 求年,注意括号内必须有内容,不得为空

求年龄可用当前系统日期的年-出生日期的年 即如下例:

select year(curdate())-year(sbirthday) as age from student // as age 是将得出的差值列为age列,即列名为age

相关文章:

  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2021-05-08
  • 2021-06-02
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2022-02-17
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2021-11-30
相关资源
相似解决方案