0
点赞
收藏
分享

微信扫一扫

MySQL中根据出生日期计算年龄

想溜了的蜗牛 2024-01-18 阅读 9

创建student表

student表中插入数据

 查询表中数据

 查询每个人的年龄

方法一:

curdate() 函数和 now() 函数的区别:

year( )函数:

方法二:

date_format( now(), '%Y') 函数和 date_format( birth, '%Y')函数:

举报

相关推荐

0 条评论