P粉4183516922023-07-26 10:42:23
You can't just concatenate strings, you must also escape the fields, using the special characters % and _:
SELECT Id, Url, ModelId WHERE Url LIKE CONCAT('%', REPLACE(REPLACE(ModelId,'%','\%'),'_','\_'), '%'), '%')
P粉1992488082023-07-26 00:00:45
SELECT Id, Url, ModelId WHERE Url LIKE CONCAT('%', ModelId, '%')