优晟SEO

您现在的位置是:首页 > CMS教程 > 帝国cms > 正文

帝国cms

MYSQL语句 去掉字段最后一个符号的方法

字段   语句   符号  
佚名 2024-08-25帝国cms
update phome_ecms_news_data_1 set infotags=left(infotags,char_length(infotags)-1) where right(infotags,1)=',';以上语句意义:查询phome_ecms_news_data_1这个表的infotags字段,如果最后一个字符是逗号删除最后一……

MYSQL语句 去掉字段最后一个符号的方法

update phome_ecms_news_data_1 set infotags=left(infotags,char_length(infotags)-1) where right(infotags,1)=',';

以上语句意义:查询phome_ecms_news_data_1这个表的infotags字段,如果最后一个字符是逗号删除最后一个字符。