如何在mysql

时间:2016-11-30 21:17:53

标签: mysql

delete from student where to_char (Student_id) like '432%';

此处的to_char功能是否真的使用过?因为我的错误显示为:

  

功能to_char不存在

2 个答案:

答案 0 :(得分:1)

TO_CHAR适用于Oracle,请参阅:http://www.sqlines.com/oracle-to-mysql/to_char_datetime

如果您要删除所有看起来像“432”或“43234”或“432 ...”的学生ID,只需使用您已发布的通配符。

如果要删除大于或等于432的所有条目:

delete from student where Student_id >= 432

答案 1 :(得分:0)

使用强制转换或转换:

delete from student where convert(Student_id,char(50)) like '432%';
delete from student where cast(Student_id as char(50)) like '432%';