SELECT * FROM dbname WHERE text = 'a%'
(this can get all the `text` fields which begin with the letter "a".)
但是如何得到第一个字母!= [a-z]的字段呢?php mysql查询第一个字母!= [a-z]
例如:
\"hello\" // this first letter begin as \ not range in a-z
いけ // also first letter not begin range in a-z
...
may also have a white space as the first character.
所以你怎么可以使用PHP MySQL查询来获取所有这些不同的结果。其中,第一个字母!=[a-z]
?
MySQL将不会在文本中使用索引,因为您已将它包装在函数中。你必须在where语句中的比较中隔离mysql的索引字段,以便在其上使用索引。 – Riedsio
@Riedsio你是什么意思? 'LEFT'可以利用指数。 – alexn