我有两张桌子employees, salary_advance
。
employees
表有列empid, name, salary
并且salary_advance
有id, empid, amount, date
我想显示所有员工的姓名,薪水,剩余..
remaining = ( salary - amount )
当我进行内部加入时,我只会得到提前的员工..
我想在员工中显示谁先行+其他员工..
这是我的 SQL 语句
select
employees.name , employees.salary ,
(employees.salary - salary_advance.amount )
from
employees
inner join
salary_advance on employees.empid = salary_advance.empid