# 創建新表並插入老表數據
create table xxx_bak select * from xxx
# 多表關聯update
update xxx x
join yyy y on y.id = x.id
set x.c = 'c'
where x.d = 'd'
# 多表關聯delete
delete x
from xxx x
join yyy y on y.id = x.id
where x.c = ''
# case when 兩種用法
# 簡單函數
CASE [col_name] WHEN [value1] THEN [result1]…ELSE [default] END
# 搜索函數
CASE WHEN [expr] THEN [result1]…ELSE [default] END