0
employee
id name
1 mark
2 Clark
3 Johnson
4 peter
emp_salary
empid sal
1 2000
2 4000
2 null
4 6000
5 null
我需要其薪水爲空員工姓名...也是我需要顯示5000,其中工資薪金爲空,在不emp_salary表中插入值如何創建虛擬表在MySQL中插入空值
我試圖
Select e.name,e.empid,e.salary
from table employee e inner join emp_salary em on e.id=em.empid
where em.salary=null
但此查詢不工作
,我需要選擇空值和空值顯示5000,而不會影響表
只需使用值'null'作爲默認值 – WASasquatch