问题标签 [mariadb-10.1]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
224 浏览

sql - MariaDB - LEFT JOIN does not return all rows

(Before you mark this as duplicate, please read the question).

I have two different tables, Bot and Switch.

For each bot, I would like to retrieve its latest status, which means: for each bot, I would like to know whether latest row's Activated field was 1 or 0. In order to return a result for those bots who do not have an entry in the Switch table, I tried to use a LEFT JOIN statement. Here is the query:

My expected result is:

Point is that I'm not getting all rows, instead this query just return a single row:

This is strange since I'm using the LEFT JOIN. In order to understand what's going on, I separately ran

and

Of course, the first query returns:

While the second one returns:

I really cannot understand why the LEFT JOIN is not keeping both Bot rows. I checked this question, but I'm not using any outer WHERE so it's not my case.
Thanks in advance!

0 投票
2 回答
1551 浏览

java - 使用 Java MariaDB 连接器的 ConnectionException

我想在我的 Java 程序和在不同服务器(不是本地主机)上使用 MariaDB 创建的数据库之间建立连接。ServerIP、Databasename、User 和 Password 一切正常。但我得到这个错误:

我的代码:

我使用的所有版本:

  • 玛丽亚数据库:10.1.44

  • MariaDB-Java-连接器:mariadb-java-client.1.2.0.jar

  • Java 版本:版本 8 更新 161

  • Eclipse 版本:2019-03 (4.11.0)

0 投票
0 回答
18 浏览

mariadb-10.1 - 如何在mysql中根据周选择数据

我想从特定月份的第 2 周中选择数据,并且我有一个包含日期的列,那么,我应该如何处理它。

我有这样的数据-

0 投票
1 回答
2205 浏览

node.js - 无法在我的虚拟服务器上开始新的 wiki.js 安装

我正在尝试在运行 Centos 7 的独立虚拟机上安装最新的 wiki.js 版本 2.5.170

https://docs.requarks.io/install/linux

Nodejs 也是最新的。

config.yml 文件中的 DB 块:

启动时:

我检查了通过 CLI 连接到数据库(使用 config.yml 上给出的相同信息),它连接良好。

我在这里想念什么?

0 投票
1 回答
714 浏览

galera - mariadb galera 节点卡在 WSREP 状态转移正在进行中

我重新启动了 mariadb galera 集群节点,现在它需要很长时间才能启动,但是我注意到状态:“WSREP 状态传输正在进行,当前 seqno:9331 等待了 510.000000 秒”并且还注意到内存:每次我重新检查 mariadb 时,内存使用量都会增加 71.3M服务状态

我该怎么办,将来避免这种情况的最佳方法是什么?

0 投票
3 回答
216 浏览

sql - 前 MariaDB 版本中的 Row_Number() 窗口函数

有谁知道如何在不支持窗口函数的版本中编写此 SQL 查询?

我发现MYSQL 5.7 Getting the row number但我不知道如何以这种方式使用 PARTITION

0 投票
1 回答
46 浏览

mariadb - 如何在字符串 MariaDB 中的每个数字后插入空格

我有一个字符串,我需要在每个数字后插入一个空格。

例如Ctn/10Btl/100ml将其转换为Ctn/10 Btl/100 ml.

你能帮我查询如何在数字后插入空格吗?

任何帮助表示赞赏。

谢谢

0 投票
1 回答
38 浏览

mysql - MySQL(低于 8.0 的版本):SELECT WHERE 多列和按最大级别分组

我的数据库中有 2 个表。

  1. 我部门的员工表。该表集中存储。我无权在此表中管理
emp_id 姓名 职位 dept_1 dept_2 dept_3
000010 emp1 名称1 导向器 首席执行官 人力资源
000012 emp2 名称2 员工 首席执行官 人力资源
000013 emp2 名称2 导向器 首席执行官 人力资源 招聘
000014 emp2 名称2 员工 首席执行官 人力资源 招聘
000015 emp2 名称2 员工 首席执行官 人力资源 招聘
.. .. .. .. ..
.. .. .. .. ..
000200 emp2 名称2 总导演 首席执行官
  1. 部门表。这是我为展示我的部门而创建的表格。
dept_id 部门级别 部门名称 部门订单
1 1 首席执行官 1
2 2 人力资源 2
2 3 招聘 3
2 3 训练 4
2 2 销售 5
2 3 销售计划 6
2 3 销售营销 7

我想知道是哪个部门的员工?

我尝试使用命令:

但这不是我想要的答案。

我想

emp_id 姓名 职位 部门级别 部门名称 部门订单
000010 emp1 名称1 导向器 2 人力资源 2
000012 emp2 名称2 员工 2 人力资源 2
000013 emp2 名称2 导向器 3 招聘 3
000200 emp2 名称2 总导演 1 首席执行官 1

我该怎么办?

PS对不起我的英语

0 投票
1 回答
46 浏览

database - MariaDB InnoDB - 将文本字段存储在不同的表中是否更有效?

使用 MariaDB 10.1 和 InnoDB 表,如果文本字段不常被引用,将 TEXT 字段存储在不同的表中是否仍然有好处?我相信这是几年前完成的事情,不确定它是否仍然适用。

行数约为 80K,插入/更新不是很频繁(用于产品描述)。假设我们没有在任何地方使用 SELECT *!

0 投票
1 回答
52 浏览

odbc - 无法在 MariaDB 中插入查询

我正在尝试 insert into Table(ID,Value,Date) Values('Test1', '33', '20210315 11:15:27.059') 使用 ODBC 驱动程序(Maria 3.1)向 MariaDB 插入查询,但出现此错误:

异常消息:错误 [22007] [ma-3.1.11][10.2.15-MariaDB]不正确的日期时间值:'20210315 11:15:27.059' 对于第 1 行的列'日期'我认为这种格式'20210315 11: MariaDB 不支持 15:27.059'。

你能帮我从数据库中更改时间格式吗?

谢谢你。