摘要:
一、为什么zookeeper要部署基数台服务器?二、zookeeper脑裂(Split-Brain)问题2.1、什么是脑裂?2.2、什么原因导致的?2.2、zookeeper是如何解决的?一、为什么zookeeper要部署基数台服务器?**所谓的zookeeper容错是指,当宕掉几个zookeepe
阅读全文
posted @ 2019-06-18 00:46
毛会懂
阅读(2486)
推荐(0)
摘要:
行转列: 多行转多列 列转行:多列转多行 以下转自:https://www.cnblogs.com/xiaoxi/p/7151433.html 一、行转列 即将原本同一列下多行的不同内容作为多个字段,输出对应内容。 建表语句 插入数据 查询数据表中的内容(即转换前的结果) 先来看一下转换后的结果:
阅读全文
posted @ 2019-06-13 13:42
毛会懂
阅读(1103)
推荐(0)
摘要:
列转行: 多列转多行 行转列:多行转多列 以下转自:https://www.cnblogs.com/ClassNotFoundException/p/6860615.html 列转行:利用max(case when then) SELECT `name`, MAX( CASE WHEN course
阅读全文
posted @ 2019-06-13 13:14
毛会懂
阅读(1271)
推荐(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
毛会懂
阅读(184)
推荐(0)
摘要:
实例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
毛会懂
阅读(251)
推荐(0)
摘要:
https://blog.csdn.net/Tim_phper/article/details/78344444
阅读全文
posted @ 2019-06-06 09:54
毛会懂
阅读(180)
推荐(0)
摘要:
参考: 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
毛会懂
阅读(943)
推荐(0)
摘要:
我们常用的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
毛会懂
阅读(8056)
推荐(0)
摘要:
https://blog.csdn.net/xiesq5112/article/details/52154169
阅读全文
posted @ 2019-06-05 13:31
毛会懂
阅读(584)
推荐(0)
摘要:
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
毛会懂
阅读(6496)
推荐(0)