MySQL查询删除第一个数字?
为此,请使用SUBSTR()。以下是语法-
update yourTableName set yourColumnName=substr(yourColumnName,2);
让我们首先创建一个表-
create table DemoTable607 (Value varchar(100));
使用插入命令在表中插入一些记录-
insert into DemoTable607 values('83967364');
insert into DemoTable607 values('10939432');
insert into DemoTable607 values('932111');使用select语句显示表中的所有记录-
select *from DemoTable607;
这将产生以下输出-
+----------+ | Value | +----------+ | 83967364 | | 10939432 | | 932111 | +----------+ 3 rows in set (0.00 sec)
这是删除第一个数字的MySQL查询-
update DemoTable607 set Value=substr(Value,2); Rows matched: 3 Changed: 3 Warnings: 0
让我们再次检查表-
select *from DemoTable607;
这将产生以下输出-
+---------+ | Value | +---------+ | 3967364 | | 0939432 | | 32111 | +---------+ 3 rows in set (0.00 sec)
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短