SQL
weixin影子
这个作者很懒,什么都没留下…
展开
-
SQL多条件统计查询
SELECT date_format(from_unixtime(created_at),'%Y%m%d')as 'time' ,count(1) as 'num',(select count(1) from tre_upgrade_log where new_grade=1 and date_format(from_unixtime(created_at),'%Y%m%d')=date_f...原创 2018-09-07 15:23:33 · 2781 阅读 · 0 评论 -
yii2学习笔记 --- 判断数据表是否存在数据库中
$table_name = '';//你的表名$ges = Yii::$app->db->createCommand("show tables ")->queryAll();//判断是否存在值是否存在二维数组中$sun = $this->deep_array($table_name,$ges);if($sun){ echo '表存在'; }else{...原创 2018-11-02 16:37:04 · 1115 阅读 · 0 评论 -
SQL语句性能优化操作策略大全
52条SQL语句性能优化策略。1、对查询进行优化,应尽量避免全表扫描,首先应考虑在where及order by涉及的列上建立索引。2、应尽量避免在where子句中对字段进行null值判断,创建表时NULL是默认值,但大多数时候应该使用NOT N...转载 2019-03-02 15:54:40 · 95 阅读 · 0 评论