随笔 - 581  文章 - 0 评论 - 48 阅读 - 131万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

06 2019 档案
mysql中,手动提交事务
摘要:1: 在mysql中,手动提交事务的案例:CREATE PROCEDURE tfer_funds (from_account int, to_account int, tfer_amount numeric(10,2)) BEGIN SET autocommit=0; UPDATE account_ 阅读全文
posted @ 2019-06-26 17:18 毛会懂 阅读(2995) 评论(0) 推荐(0) 编辑
java 发送邮件
摘要:maven依赖: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.5</version> </dependency> 文件一:Mail.java 阅读全文
posted @ 2019-06-19 18:28 毛会懂 阅读(202) 评论(0) 推荐(0) 编辑
zk脑裂
摘要:一、为什么zookeeper要部署基数台服务器?二、zookeeper脑裂(Split-Brain)问题2.1、什么是脑裂?2.2、什么原因导致的?2.2、zookeeper是如何解决的?一、为什么zookeeper要部署基数台服务器?**所谓的zookeeper容错是指,当宕掉几个zookeepe 阅读全文
posted @ 2019-06-18 00:46 毛会懂 阅读(2463) 评论(0) 推荐(0) 编辑
mysql 行转列 列转行
摘要:行转列: 多行转多列 列转行:多列转多行 以下转自:https://www.cnblogs.com/xiaoxi/p/7151433.html 一、行转列 即将原本同一列下多行的不同内容作为多个字段,输出对应内容。 建表语句 插入数据 查询数据表中的内容(即转换前的结果) 先来看一下转换后的结果: 阅读全文
posted @ 2019-06-13 13:42 毛会懂 阅读(1097) 评论(0) 推荐(0) 编辑
MySQL -- 行转列 -- GROUP_CONCAT -- MAX(CASE WHEN THEN)
摘要:列转行: 多列转多行 行转列:多行转多列 以下转自:https://www.cnblogs.com/ClassNotFoundException/p/6860615.html 列转行:利用max(case when then) SELECT `name`, MAX( CASE WHEN course 阅读全文
posted @ 2019-06-13 13:14 毛会懂 阅读(1245) 评论(0) 推荐(0) 编辑
单表查找重复的数据
摘要:SELECT base.* from(select id_no,COUNT(*) from aim.aim_t_cust_base GROUP BY id_no HAVING COUNT(*) >1) as t left join aim.aim_t_cust_base base on t.id_n 阅读全文
posted @ 2019-06-12 14:52 毛会懂 阅读(181) 评论(0) 推荐(0) 编辑
mysql求中位数
摘要:实例1: SET @ID = 0; SELECT AVG(loan_amount) from ( SELECT @ID:=@ID+1 as ID, loan_amount FROM table_xxx ORDER BY loan_amount ) a where IF( ROUND(@ID/2,0) 阅读全文
posted @ 2019-06-12 11:37 毛会懂 阅读(241) 评论(0) 推荐(0) 编辑
MYSQL一次千万级连表查询优化
摘要:https://blog.csdn.net/Tim_phper/article/details/78344444 阅读全文
posted @ 2019-06-06 09:54 毛会懂 阅读(176) 评论(0) 推荐(0) 编辑
MySQL高级 之 order by、group by 优化
摘要:参考: https://blog.csdn.net/wuseyukui/article/details/72627667 order by示例 示例数据: Case 1 Case 2 Case 3 Case 4 结论:order by子句,尽量使用Index方式排序,在索引列上遵循索引的最佳左前缀原 阅读全文
posted @ 2019-06-06 09:05 毛会懂 阅读(926) 评论(0) 推荐(0) 编辑
SQL IN 子查询返回多对值
摘要:我们常用的IN 操作是这样的: select * from tab twhere t.col1 in ('value1''value2');12但是如果是多个列的取值来自同一个子查询呢? 我们是不是要这样写了? select * from tab1 t1where t1.col1 in (selec 阅读全文
posted @ 2019-06-05 13:31 毛会懂 阅读(8047) 评论(0) 推荐(0) 编辑
MySQL开发技巧 第二禅(子查询中匹配两个值、解决同属性多值过滤的问题、计算累进税的问题)
摘要:https://blog.csdn.net/xiesq5112/article/details/52154169 阅读全文
posted @ 2019-06-05 13:31 毛会懂 阅读(577) 评论(0) 推荐(0) 编辑
MYSQL --Subquery returns more than 1 row查询结果多于一行
摘要:Subquery returns more than 1 row表示子查询返回了多行数据 例如: select * from table1 where table1.colums=(select columns from table2) 解决方法 select * from table1 where 阅读全文
posted @ 2019-06-05 13:30 毛会懂 阅读(6477) 评论(0) 推荐(0) 编辑
mysql 多个字段的查询处理
摘要:https://blog.csdn.net/zzzgd_666/article/details/81101548 阅读全文
posted @ 2019-06-03 18:56 毛会懂 阅读(2740) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示