如何修复错误代码:1054。我的sql

时间:2017-06-13 12:55:48

标签: mysql

我写下面的代码,我有错误代码:1054。未知栏' referenceinfo.mid'在条款'中     create table newenron as SELECT employeelist.eid ,employeelist.firstName ,employeelist.lastName ,employeelist.Email_id ,employeelist.status ,message.mid ,message.sender ,message.subject ,message.body ,message.folder ,recipientinfo.rid ,recipientinfo.mid ,recipientinfo.rvalue ,referenceinfo.rfid ,referenceinfo.mid ,referenceinfo.reference FROM employeelist INNER JOIN message ON employeelist.Email_id = message.sender INNER JOIN recipientinfo ON message.mid = referenceinfo.mid INNER JOIN referenceinfo ON recipientinfo.rid = referenceinfo.rfid我该如何解决? 谢谢你抽出宝贵的时间。

2 个答案:

答案 0 :(得分:1)

您错误拼写了一个列名。但是由此我看不出哪一个。

答案 1 :(得分:0)

下面

public ActionResult Redirect(int id, string url)
{
   //Get record using ID, and update Hits column

   //Redirect to the final URL
   return Redirect(url);
}

您是否正在加入 recipientinfo 表格,但请参考 referenceinfo

据我所知,

  • recipientinfo
  • referenceinfo

是两个不同的表格。

你可能想要的是

 INNER JOIN recipientinfo ON message.mid = referenceinfo.mid

INNER JOIN recipientinfo ON message.mid = recipientinfo.mid