大鹅努力学编程 2023-04-14 18:04 采纳率: 85.7%
浏览 14

用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

  • 写回答

2条回答 默认 最新

  • nssnail 2023-04-15 10:55
    关注

    报错截图?

    评论

报告相同问题?

问题事件

  • 创建了问题 4月14日

悬赏问题

  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表