为什么80%的码农都做不了架构师?>>>
方法1:
SELECT eFROM entity eWHERE(0 < LOCATE(:searchStr, e.property))
函数LOCATE(searchString, candidateString [, startIndex]),用于查找目标字符串searchString在候选字符串candidateString中的下标index(从1开始,非0开始)。
方法2:
SELECT eFROM entity eWHERE(0 < CONCAT(:searchStr, '%'))
函数CONCAT(string1, string2),用于连接两个表字段或常量。