查询大量行时,什么可以替代 LIKE 运算符?
P粉191610580
P粉191610580 2023-09-02 13:02:15
0
1
313
<p>我有一个表,其中有一列存储随机字符串,如下所示:</p> <pre class="brush:php;toolbar:false;">example_id = qwhs77gt65g7*</pre> <p>现在该列上的一些数据带有星号 (*),而其他数据则没有。</p> <p>我需要选择那些有的。我正在使用这个查询:</p> <pre class="brush:php;toolbar:false;">SELECT example_id FROM example_tbl WHERE example_id LIKE ‘%*%’</pre> <p>现在这通常不是问题,但我正在查询数百万行,据我所知,LIKE 运算符正在影响我的性能。完成查询需要几个小时</p> <p>我的问题是 LIKE 运算符的替代方案是什么?</p> <p>PS 星号始终位于字符串的末尾。不知道是否有帮助</p>
P粉191610580
P粉191610580

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!