sql取出商品表每个类别的前3条记录
select * from goods a where (select count(id) from goods b where b.c_id=a.c_id and b.id>a.id) <3
2016-08-21 18:02
建立varchar字段的索引时,提示Specified key was too long; max key length is 767 bytes
字段设置unique索引的时候,是Mysql的字段设置的太长了,把相关字段的长度改了一下就好了。 建立索引时,数据库计算key的长度是累加所有Index用到的字段的char长度后再按下面比例乘起来不能超过限定的key长度1000:latin1 = 1 byte = 1 characteruft8 = 3 byte = 1 ...
2016-03-08 11:00
mysql锁
查询被锁住的表show OPEN TABLES where In_use > 0; http://www.cnblogs.com/chenwenbiao/archive/2012/06/06/2537508.html
2015-12-19 15:12
mysql死锁相关
http://blog.sina.com.cn/s/blog_66519bd80102v3ct.htmlhttp://blog.chinaunix.net/uid-10661836-id-4090576.html http://blog.csdn.net/dc_726/article/details/8576151/ SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; SELECT * FROM INFORMATION_SCHEMA.INN ...
2015-07-26 00:39
12