簡體   English   中英

如何在MySQL中使用to_char函數

[英]How to use to_char function in mysql

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

to_char函數在這里是真的使用嗎? 因為我的錯誤顯示是:

FUNCTION to_char不存在

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

使用強制轉換或轉換:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM