首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >我想用多个条件连接多个表

我想用多个条件连接多个表
EN

Stack Overflow用户
提问于 2018-12-18 02:40:15
回答 1查看 370关注 0票数 -1

下面是我的问题

代码语言:javascript
复制
SELECT salary.id,
       employee.emp_id,
       employee.emp_name,
       department.dept_name,
       designation.desig_name,
       salary.basic,
       salary.house_rent + salary.conveyance + salary.medical + salary.dearness + salary.others_allowances AS allowances,
       salary.income_tax + salary.pro_tax + salary.emp_state_insu + salary.others_deductions AS deductions,
       Sum(attendance.attendance = 'Absent') * salary.absence_fine AS fine,
       Monthname(attendance.date) AS month,
       salary.month AS monYear
  FROM employee
       INNER JOIN attendance ON employee.emp_id = attendance.emp_id
       INNER JOIN department ON employee.dept_id = department.dept_id
       INNER JOIN designation ON employee.desig_id = designation.desig_id
       INNER JOIN salary ON designation.desig_id = salary.desig_id
  GROUP BY salary.id,
           employee.emp_id,
           Monthname(attendance.date)  

我的输出是:

请帮我弄清楚这个问题

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53821251

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档