2
select
file,
REPLACE(FILE, '[:alnum:]'+'.'+,'') AS Collection
FROM
CollectionData;
select
file,
REPLACE(FILENAME, '^[a-zA-Z0-9\.]','') AS Collection
FROM collectiondata;
我想從字符串中替換所有非字母數字字符,包括字符串中的.file擴展名,如下所示。用空字符串替換非字母數字字符MYSQL
AXS00003600.txt to AXS
NXS4DG00003600.txt to NXS4DG
我無法在執行上述查詢時替換非字母數字數據。可能是什麼問題呢?
可能重複的[MySQL:如何從字符串中刪除所有非字母數字字符?](http://stackoverflow.com/questions/6942973/mysql-how-to-remove-all-non-alpha- numeric-characters-from-a-string) – Kzqai