How to remove all non-alpha numeric characters from a string in MySQL?
问题 I\'m working on a routine that compares strings, but for better efficiency I need to remove all characters that are not letters or numbers. I\'m using multiple REPLACE functions now, but maybe there is a faster and nicer solution ? 回答1: None of these answers worked for me. I had to create my own function called alphanum which stripped the chars for me: DROP FUNCTION IF EXISTS alphanum; DELIMITER | CREATE FUNCTION alphanum( str CHAR(255) ) RETURNS CHAR(255) DETERMINISTIC BEGIN DECLARE i, len