Questions tagged «mariadb»

开源RDBMS旨在替代MySQL。如果该上下文很重要,请添加特定于版本的标记(例如mariadb-10.2)。

1
MySQL下的数据库大小与磁盘上的实际大小之间存在实质性差异
当我检查MySQL下数据库的大小时,得到以下信息: MariaDB [(none)]> SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema; +--------------------+----------------------+------------------+ | Data Base Name | Data Base Size in MB | Free …
8 ubuntu  mysql  mariadb 

3
从星期四或一周中的任何一天开始,如何改善每周语句的SQL语句?
我是一个新手,我找不到在任何地方执行此操作的好方法。我有一个数据库表,其中包含一周中不同时间记录的统计信息。报告周从星期四开始。该表包含一个datestamp列(日期),该列存储记录数据的时间。 我需要提取给定一周的数据(报告周从星期四开始)。我写了以下查询: SELECT * FROM `table` WHERE 1 = CASE WHEN WEEKDAY(NOW()) = 0 THEN DATEDIFF(NOW(),`date`) BETWEEN -2 AND 4 WHEN WEEKDAY(NOW()) = 1 THEN DATEDIFF(NOW(),`date`) BETWEEN -1 AND 5 WHEN WEEKDAY(NOW()) = 2 THEN DATEDIFF(NOW(),`date`) BETWEEN -0 AND 6 WHEN WEEKDAY(NOW()) = 3 THEN DATEDIFF(NOW(),`date`) BETWEEN -6 AND 0 …
8 mysql  mariadb 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.