select id,name,select count(*) from table1 where table1.infor regexp 'g'+table2.id+'(g|$)' as count from table2
如统计table1的infor字段里有g24但没有g240(这24是table2.id自动赋予的),但现在的语句不能区分,请大神赐教!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
查了一下mysql的文档,原来很简单,mysql有个专门的字符串连接的函数concat,(汗,是自己一直没好好学习的结果。)现在正确的查询语句如下:
不知道有没有更好的方案呢?