愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

mysql 用select更新資料

post date - 2023/07/01
last update - 2023/07/01

最近碰到了需要一次性將A表格的資料更新到B表格的狀況,順便記錄一下mysql的語法。

參考資料:https://stackoverflow.com/questions/1262786/mysql-update-query-based-on-select-query

使用select資料來更新需要更新的表格,如果a表格的欄位已經有資料的話就不更新。

UPDATE updatetable a
INNER JOIN selecttable b ON a.USER = b.USER
SET a.email = if(a.email = '', b.EMail, a.email)
WHERE a.Class='條件'
Tags : mysql

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

Recent Posts

javascript 統一編號檢查

2023/12/17

php 強型態

2023/07/22

css 動態計算功能

2023/10/15

3D AI 試玩(NVIDIA get3d)

2022/11/02

javascript鎖定右鍵

2022/07/02

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2026 愚者樹屋