VirtualBox 安裝 macOS Mojave
二、八、十與十六進位 (數字系統) 轉換教學
PHP 單檔案上傳、多檔案上傳教學範例
Eclipse 下載安裝與使用教學 for Java
AJAX JavaScript 與 jQuery 教學範例 for PHP
Laravel 11 Sanctum JWT API 認證建置教學
AlmaLinux 9 伺服器作業系統安裝和設定
台灣喉科醫學會
簡訊群發系統 (客製化串接所有商家簡訊 SMS API)
Laravel 9 JSON Web Token (JWT) 身份驗證教學範例 for Web RESTful API
employees.name AS employees_name,
clocks.id AS clocks_id,
DATE_FORMAT(clocks.in_time, '%Y-%m-%d %H:%i') AS clocks_in_time,
DATE_FORMAT(clocks.out_time, '%Y-%m-%d %H:%i') AS clocks_out_time
FROM employees
LEFT JOIN clocks
ON employees.id = clocks.employees_id
employees.id AS employees_id,
employees.name AS employees_name,
DATE_FORMAT(clocks_first.in_time, '%Y-%m-%d %H:%i') AS clocks_first_in_time,
DATE_FORMAT(clocks_last.out_time, '%Y-%m-%d %H:%i') AS clocks_last_out_time
FROM employees
-- 子查詢,僅關聯 in_time 最早一筆日期時間記錄
LEFT JOIN (
SELECT
c1.in_time,
c1.employees_id
FROM employees
JOIN clocks AS c1
ON (employees.id = c1.employees_id)
LEFT OUTER JOIN clocks AS c2
employees.id = c2.employees_id
AND (
c1.in_time > c2.in_time
OR c1.in_time = c2.in_time
AND c1.id > c2.id
WHERE c2.id IS NULL
) AS clocks_first
ON clocks_first.employees_id = employees.id
-- 子查詢,僅關聯 out_time 最後一筆日期時間記錄
LEFT JOIN (
SELECT
c1.out_time,
c1.employees_id
FROM employees
JOIN clocks AS c1
ON (employees.id = c1.employees_id)
LEFT OUTER JOIN clocks AS c2
employees.id = c2.employees_id
AND (
c1.out_time < c2.out_time
OR c1.out_time = c2.out_time
AND c1.id < c2.id
WHERE c2.id IS NULL
) AS clocks_last
ON clocks_last.employees_id = employees.id