mysql max min 必须放在-条件之后
发表于|更新于|mysql
1 | SELECT *,max(marks) FROM `form_log` where reason = 'astrazeneca' group by userid |
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2018-05-08
swoole 协程 mysql 客户端等 进一步说明
官网文档已经说明了协程mysql客户端的使用方法有几种情况 只有一个协程客户端,同步代码 异步执行官网实例已经说明,如下 https://wiki.swoole.com/wiki/page/p-coroutine_realization.html 多个协程客户端 同步代码 异步执行其实就像默认的,他会按如上的顺序逐个执行 多个协程客户端 并发执行并发执行主要涉及到两个方法setDefer延迟发送和recv收包setDefer对下一行的io起作用,也就是不在那里进行收包,而是手动收包,从而达到并行效果测试代码 123456789101112131415161718192021222324252627282930313233343536$http->on('request', function ($request, $response) use ($http, &$n) { if ($request->server['request_uri'] == '/favicon.ico'...
2018-01-24
redis mysql 性能记录 读写速度 windows linux
thinkphp5.0.10运行时间记录 centos7.2 腾讯云 1核1G 高效云盘 逐个写入redis lpush 100000条 3.381005smysql insert 100000条 23.706291s 获取最后redis rpop 0.001823smysql order|limit 0.003046s 索引查找redis lindex 0.001536smysql id 0.002653S windows10 2核4G SSD 逐个写入redis lpush 10000 12.013191smysql insert 10000 41.127062s 获取最后redis rpop 0.054366smysql order|limit 0.066480s 索引查找redis lindex 0.054666smysql id 0.069864s
2020-06-10
mysql laragon 启动 报错
更换laragon的mysql版本后突然出现如下错误 1Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 解决方法将下载的mysql5.5目录里自带的data文件夹复制到laragon的data文件夹里
2020-04-13
mysql 管理
创建数据库1CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci; 创建用户1create user 'user'@'%' identified by '123'; 授权用户1grant all privileges on db.* to 'user'@'%'; 查看用户1show grants for 'user'@'%'; 修改密码123use mysql; update user set password=password('123') where user='root' and host='localhost'; flush privileges; mysql8密码问题1ALTER USER 'native'@&...
2019-03-19
mysql 统计重复记录数量
123456SELECT COUNT(*) as total FROM ( SELECT count(openid) as t FROM user GROUP BY `openid` HAVING t > 1 limit 1000) as a 如果下面写法会很慢 123456SELECT COUNT(*) as total FROM form_user WHERE id IN( SELECT count(id) FROM form_user GROUP BY `openid` HAVING COUNT(openid) > 1 limit 1000)
2016-07-30
mysql 找出重复数据
1SELECT * , count(openid) as count FROM `cul_logindata` GROUP BY `openid` HAVING count>1
公告
This is my Blog