用to_days比较年龄报错

查询其他系中存在比计算机系某一学生年龄小的学生(即年龄小于计算机系年龄最大者的学生)。
为什么用to_days比较年龄报错

//to_days()比较年龄
mysql> select sname,timestampdiff(year,sbirthday,curdate()) from student
    -> where to_days(sbirthday)<(select min(to_days(sbirthday)) from student
    -> where sdept='计算机系')
    -> and sdept<>'计算机系';
Empty set (0.00 sec)
//timestampdiff()比较年龄
mysql> select sname,timestampdiff(year,sbirthday,curdate()) from student
    -> where timestampdiff(year,sbirthday,curdate())<(select min(timestampdiff(year,sbirthday,curdate())) from student
    -> where sdept='计算机系')
    -> and sdept<>'计算机系';

img

报错截图?

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^