database
文章平均质量分 71
走向自由
追随自己内心的声音,走向自由。
展开
-
Cassandra Java Driver Reference 4.11
文档入口: https://docs.datastax.com/en/developer/java-driver/4.11/ 1 Session Build import com.datastax.oss.driver.api.core.CqlSession; import com.datastax.oss.driver.api.core.cql.*; try (CqlSession session = CqlSession.builder().build()) { ...转载 2021-04-24 21:56:12 · 330 阅读 · 1 评论 -
[Cassandra] static column
How are static columns stored internally in cassandra? Can someone please post an example discussing the design implementation of static column in cassandra? Why don't we take a look at the structure of a table with static columns on disk and find out?.转载 2021-04-07 14:26:19 · 121 阅读 · 0 评论 -
Cassandra primary key, composite key, partition key, clustering key 的区别
Difference between partition key, composite key and clustering key in Cassandra? There is a lot of confusion around this, I will try to make it as simple as possible. The primary key is a general concept to indicate one or more columns used to retrie..转载 2021-04-07 14:07:41 · 223 阅读 · 0 评论 -
Update MySql table with reference to the same table.
It seems very easy. As if it can be done by just adding a subquery inside where condition. But it’s not like that. Problem For the demonstration, I have created a sample table with some dummy records as below. UPDATE product p SET p.p..转载 2021-01-12 17:33:19 · 116 阅读 · 0 评论 -
How to set a local list/tuple variable in mysql
SET @list = 'a,b,c'; SELECT * FROM myTable WHERE FIND_IN_SET(myField, @list) > 0; FIND_IN_SET(str,strlist) Returns a value in the range of 1 toNif the stringstris in the string liststrlistconsisting ofNsubstrings. A string list is a string ...转载 2021-01-12 17:30:05 · 108 阅读 · 0 评论 -
面试总结SQL 经典面试题
原文: https://www.cnblogs.com/yoyoketang/p/10118924.html 前言 用一条SQL 语句查询xuesheng表每门课都大于80 分的学生姓名,这个是面试考sql的一个非常经典的面试题 having和not in 查询 xuesheng表每门课都大于80 分的学生姓名 name kecheng score 张三 语文 81 张三 数学 73 李四 语文 86 李四 数学 .转载 2020-12-02 11:17:26 · 292 阅读 · 0 评论 -
Mysql 条件函数
1 IF IF(expr1,expr2,expr3) Ifexpr1isTRUE(expr1<> 0andexpr1<> NULL),IF()returnsexpr2. Otherwise, it returnsexpr3. mysql> SELECT IF(1>2,2,3); -> 3 mysql> SELECT...原创 2020-03-08 18:55:17 · 301 阅读 · 0 评论 -
hibernate oneToMany 记录重复 和异常org.hibernate.LazyInitializationException: failed to lazily initializ
问题:最近项目中使用hibernate4+spring4进行数据库访问时,发现一个记录下有五个子项目时竟然返回五条重复记录。 初始环境:hibernate 每个用户对应一个小组 。user--group(many to one)。group--user(one to many) Group代码片段 @OneToMany(mappedBy="group", fetch=FetchT...转载 2018-08-10 10:33:21 · 599 阅读 · 0 评论 -
Hive 运行模式总结
Hive 基础概念 Hive是基于Hadoop的一个数据仓库,Hive能够将SQL语句转化为MapReduce任务进行运行。 Hive架构图分为以下四部分。 1、用户接口 Hive有三个用户接口: 命令行接口(CLI):以命令行的形式输入SQL语句进行数据数据操作 Web界面:通过Web方式进行访问。 Hive的远程服务方式:通过JDBC等...原创 2020-03-15 22:51:14 · 795 阅读 · 0 评论