Home > Database > Mysql Tutorial > body text

mysql-Mysql向表中某个字段添加有规律字符串怎么写SQL语句?例如(1P,2P,3P)

WBOY
Release: 2016-06-06 09:41:44
Original
1361 people have browsed it

字符串mysql

图片说明
如图所示
表 b 有三个字段aid,partname,partid,我希望partid字段可以根据partname字段的值添加有规律的字符串。
例如 partname字段值为PART 1则partid字段添加值 1P,partname字段值为PART 2则partid字段添加值 2P,
partname的值除了上述格式还有TV 01,TV 02,特征都是字符串有(无)空格加数字,
还有种就是数字夹在字符串中间的,第1話,第2話,第11話.最后一种最简单的是纯数字,1,2,3
反正就是用语句把这三种特征的字段其中的数字提取出来,在partid字段添加1P,2P,
3P的值。
请问各位数据库大神这样应该怎么写SQL语句?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!