仅从 MySQL 数据库中检索以“ing”结尾的 8 个字符或更少字符的单词


Only retrieve words with 8 or less characters ending in "ing" from MySQL database

我只需要从MySQL数据库中检索8个字符或更少字符并以"ing"结尾的单词。

我正在使用 php,感谢您的帮助!

谢谢

喜欢

很容易

SELECT * FROM table WHERE field LIKE '%ing' AND LENGTH(field) <= 8
SELECT * FROM table WHERE field RLIKE '^.{0,5}[iI][nN][gG]$';

Select column from Table Where column like '%ing' and Length( column ) <=8

使用正则表达式

Select column From table Where column REGEXP '^.{0,5}ing$'

REGEXP 不区分大小写,将处理大写和小写字符