select * from tt a where 2>=(select count(*) from tt where a.title=title)
解决方案 »
- MYSQL 取出字段 怎么强制成整型
- winfrom查询MSQL语句後编码问题
- 关于MYSQL多条件查询orderby优化的问题
- 在 linux下输入"mysql"命令,进入mysql命令行,但出现“Can't connetc to local MySQL server thuough socket /var/lib/mysql/mysql.sock
- postgresql 是否支持全文检索?
- 如何插入名次字段数据?
- select 加上group by后好慢
- mysql 优化问题-groupby orderby 对主键分组和排序很慢
- mysql,oracle
- mysql 5.7.17老版本binlog恢复出的sql无法导入数据库问题
- 只能连续回复3次无奈再次发贴
- mysql用hibernate保存数据时,只保存了字符串的一部分
and a.userid=userid
)
char_length( title) #获得字符串长度
replace( title, “vip保过版” ) #将字符串中的A替换为空
char_length( title) – char_length( replace( title, “vip保过版”, ” ) ) #计算得到差就是被替换的字符串的个数
select char_length( title) – char_length( replace( title, “vip保过版”, ” ) ) from tt a where 1 group by userid
但每次只能查询一个....
查询结果
并不是我想要的啊
select userid,group_concat(distinct title),group_concat(distinct oid) from `djs_shops_products` a where 2>=(select count(*) from `djs_shops_products` where a.title=title and a.userid=userid)group by userid;
我有这么修改了一下,但是结果导致他的>=的条件判断好像失败了
直接运行,不加入group_concat,结果是什么