连接表引发错误,因为找不到表

时间:2018-10-30 22:32:19

标签: javascript mysql express

我在名为team的数据库中有两个表team_position_localebaltika

出于翻译原因,我试图加入表格,并且不断抛出我Unknown table 'team' in field list

这是我的查询

app.post('/getTeam', (req,res) => {
  const join = "SELECT team.first_name AS firstName, " + 
  "team.last_name AS lastName, " +
  "team.picture AS picture, " +
  "locale.title AS title "
  "FROM baltika.team AS team " +
  "JOIN baltika.team_position_locale AS locale " + 
  "ON team.position_id = locale.object_id " +
  "WHERE locale.locale = ?"
  connection.query(join, [req.body.locale], function(err, result) {
    if(err) throw err;
    console.log(result)
    res.send(result);
  })
});

我是查询的新手,所以它肯定在其中……我只是不知道在哪里。任何帮助将不胜感激!

0 个答案:

没有答案