![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
文章平均质量分 67
q309572960
这个作者很懒,什么都没留下…
展开
-
Oracle的sql
查看表字段相关定义 select * from all_col_comments where table_name=upper('recsheet') ;原创 2021-06-23 08:52:55 · 164 阅读 · 0 评论 -
日常sql
-- 查询包含两条以上订单的客户id select c.customer_id,count(o.order_id) as tcount from crm_customer c inner JOIN crm_customer_external ce on c.customer_id = ce.customer_id inner join crm_order_info o on ce.external_userid=o.source_customer_id and ce.channel_type = o.c原创 2021-03-29 09:39:21 · 358 阅读 · 1 评论 -
一次 SQL 查询优化原理分析(900W+ 数据,从 17s 到 300ms)
https://mp.weixin.qq.com/s/aeAI7K8VVkUN3w_jvXZcmA 有一张财务流水表,未分库分表,目前的数据量为9555695,分页查询使用到了limit,优化之前的查询耗时16 s 938 ms (execution: 16 s 831 ms, fetching: 107 ms),按照下文的方式调整SQL后,耗时347 ms (execution: 163 ms,...原创 2020-04-17 08:35:44 · 142 阅读 · 0 评论 -
日常sql
DELETE w1 from wechat_applet_member_info w1,wechat_applet_member_info w2 WHERE w1.unionid = w2.unionid and w1.id<w2.id原创 2019-05-17 18:48:49 · 76 阅读 · 0 评论 -
mysql死锁解决方案
select * from information_schema.innodb_trx kill 42273 (42273位死锁的进程id)原创 2019-07-31 09:50:35 · 224 阅读 · 0 评论