ISNULL是判断是否为NULL
而NULLIF是把值换成NULL
COALESCE是用别的来代替NULL
SELECT employee_id,first_name,last_name,NULLIF (SALES_QUOTA,-1) as Quota
FROM employees
就是把-1变成 NULL
COALESCE(表达式1,表达式2,....表达式n)
从前到后,谁不是NULL就显示谁
Select employee_id,first_name,last_name,
COALESCE ( appt_quota,(Select Min(appt_quota) From employees),0 ) AS quota
From employees
Where department = 'Marketing'