Skip to content

Benjr.tw

  • Linux
    • Stress & Performance
    • Hardware Info
    • System Monitor
    • Security
    • Desktop
    • PXE
    • Filesystem Hierarchy Standard
    • Linux 開機選項
    • Linux Package Manager
    • 備份 Backup
  • Virtualization
    • Docker & Podman
    • CoreOS
  • NAS/SAN
  • Programming Language
    • Python
    • Bash shell script
    • Perl
    • PHP
    • Node.JS
    • VBA
    • javascript
    • Power Query
    • PowerShell
  • WordPress
  • DataBase
    • 資料庫安裝
    • 資料庫語法
    • SQLite
    • MariaDB JSON

MariaDB

MySQL- Convert Column to Row (Pivot Table 樞紐分析表)

2019-09-112022-11-23 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 7 x86_64 (虛擬機) 將資料庫的列 (Column) 轉換為行 (row) 來呈現 (Pivot Table : 樞紐分析表) 其統計結果,如下圖所示. 先建立要測試用的資料庫. 利用 GROUP BY 以及 ORDER BY 來統計資料. 使用如下函數: SUM […]

Read more

MariaDB – 常用處理數字函數 ( Numeric Functions )

2019-09-092021-06-30 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 8 x86_64 虛擬機. 字串函數 ( String Functions ) 與 型別轉換 – https://benjr.tw/102953 數字函數 (Numeric Functions) – 這邊介紹. 日期與時間函數 (Date &#038 […]

Read more

PHPMyAdmin – 資料無法匯入

2019-09-092019-11-05 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境 CentOS 7 64bits + Apache 我們可以透過 MyPHPAdmin 的匯入 ( Import )功能,把資料匯入資料庫,但當資料大於 2M 時會出現以下的資訊. 主要是被 PHP 上傳檔案 2M 的上限所限制住,我們可以透過 PHP 函數 phpinfo() 來看一下目前 […]

Read more

SQL 語法 – Multiple Tables JOIN

2019-09-042021-05-26 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 7 x86_64 虛擬機. 前面有討論到 SQL 語法 JOIN 與 UNION – https://benjr.tw/101855 ,可以把兩個 Table 的資料結合處理,多個 Table 也可以嗎? 是的,直接來看下面的範例. 下面範例有三個 Table. […]

Read more

SQL – Database normalization

2019-08-212019-08-20 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 7 x86_64 虛擬機. 規劃資料庫欄位很重要. 下面範例有兩個 Table. project (存放專案名稱與相對應人員名單) staff (存放員工姓名與部門) project 這個資料表主要儲存專案的相關資料. staff 這個資料表主要儲存員工的相關資料. 並在 […]

Read more

SQL 語法 – JOIN

2019-08-202021-05-26 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 7 x86_64 虛擬機. 多個資料表單有相對應的欄位時,我們可以透過 JOIN 來同時查詢多個資料表單的資料. 下面範例有兩個 Table. project (存放專案名稱與相對應人員名單) project 這個資料表主要儲存專案的相關資料. 在 project 資料表建 […]

Read more

SQL 語法 UPDATE (保留原資料)

2019-08-012020-11-16 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

SQL 語法 UPDATE 是用來更新原紀錄的資料,但有辦法可以保留原資料+新資料嗎? 可以透過 SQL 函數 CONCAT 與 CONCAT_WS . 測試環境為 CentOS 7 x86_64 虛擬機. CONCAT CONTACT 函數可以將兩個或更多個字串連接在一起. 直接來看範例. 要注意 […]

Read more

SQL 資料型態 – TEXT Data & LOAD_FILE 函數

2019-07-302021-03-03 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

這邊來看一下 TEXT Data 這個資料型態. 測試環境為 CentOS 7 x86_64 虛擬機. Data Type Storage Required TINYBLOB , TINYTEXT 字元上限 255 bytes ( 2^8 -1 ),使用 1 bytes 紀錄前面字元使用長度. BL […]

Read more

SQL 語法 EXPLAIN

2019-07-262019-08-01 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

測試環境為 CentOS 7 x86_64 虛擬機 當我們使用 SELECT 時要如何得知其搜尋效能? 這時候可以透過 EXPLAIN 來看. 先建立一個測試用資料庫 (testdb) , 與 tables (employee) 格式為 Name char(20), Dept char(20), j […]

Read more

SQL 語法 SELECT REGEXP

2019-07-042022-09-13 adminLinux, MariaDB, Mysql, RedHat / CentOS

Loading

SQL 語法 SELECT 的字串比對 (需注意資料庫字元編碼 Character Sets 與 文字排序 Collations ,請參考資料庫編碼 – https://benjr.tw/102156 ),除了常用 LIKE – https://benjr.tw/98899 […]

Read more

文章導覽

較舊的文章
較新的文章

近期文章

  • Windows – Network Sharing + Port forwarding to VM
  • Ansible – gather facts
  • Ansible – host_vars 定義特定的變量
  • Ansible 範例 – Chrony daemon
  • Ubuntu NTP Client 校時設定

近期留言

  • 「Jackson2734」於〈Ubuntu NTP Client 校時設定〉發佈留言
  • 「w」於〈Ubuntu 16.04 Server PXE 安裝〉發佈留言
  • 「admin」於〈TCP/IP 常見封包〉發佈留言
  • 「stu」於〈TCP/IP 常見封包〉發佈留言
  • 「student」於〈Linux command – tcpdump〉發佈留言

分類

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文
  • Privacy Policy
  • 隱私權政策
Powered by WordPress | Theme: Astrid by aThemes.