mysql 执行计划

SQL 

mysql 执行计划mysql 执行计划只需要在需要执行的语句前加上EXPLAIN关键字就可以查看执行计划了如表explain select name, nickname, ctime from dt_user where city = 'shanghai' order by nam

分页SQL

SQL 

分页SQLTop(最慢,not in 数据庞大,而且不走索引,但支持性好,基本sql都支持)select top (@pagesize) * from Customers where CustomerID not in (select top ((@pageindex - 1)* @pagesize

特殊sql

SQL 

-- 按照时间分组,并统计数量SELECT DATE_FORMAT(CreateTime,"%Y年%m月%d日") AS dates,COUNT(*) from orders_1428542131437314052GROUP BY DATE_FORMAT(CreateTime,&