我有一個這樣的數據庫:SQL:從字符串的結尾處,刪除#標籤
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| PosScore | float | YES | | NULL | |
| NegScore | float | YES | | NULL | |
| SynsetTerms | varchar(45) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
一些SynsetTerms有#結尾。 我可以只使用SQL查詢並將其刪除嗎?
在此先感謝。如果你想刪除的'#'
所有出現
update t
set SynsetTerms = left(SynsetTerms, length(SynsetTerms) - 1)
where SynsetTerms like '%#';
:
這意味着有喜歡**秋季#一些值**和我想改變它只是**秋天** –