如何获取在第二个表中有两个电话号码的员工姓名和ID

时间:2016-09-29 07:40:21

标签: join common-table-expression derived-table

enter image description here

这两个表1. emp_table,2。phone_table。 如何获取在第二个表中有两个电话号码的员工姓名和ID

1 个答案:

答案 0 :(得分:0)

router.get('/employee', function(req, res) {
  models.EmployeeView.findAll({
    where: {
      active: req.query.active
    }
    include: [{
      model: models.EmployeeCategory
    }, {
      model: models.EmployeeFile,
       }]
  }).then(function(employee) {
    res.json(employee);
  });
});