求助 1054 - Unknown column '*' in 'where clause'的问题

cailiming1983 2014-07-24 10:12:56
想从第二张表中取值为第一张表的某些字段赋值,频频报1054错误,找不到字段名称,其中amount_compare,amount_20140630是两张表,ibk_name是两张表都拥有的字符型字段,具体代码如下,请帮忙看看。
数据库是mysql 5.6.19

mysql> INSERT INTO amount_compare (custom_count_20140630,amount_20140630,rate_20140630) select custom_count as custom_count_20140630,amount as amount_20140630,rate as rate_20140630 from amount_20140630 where amount_compare.ibk_name=amount_20140630.ibk_name;
1054 - Unknown column 'amount_compare.ibk_name' in 'where clause'
...全文
14374 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
知道就是你 2014-08-28
  • 打赏
  • 举报
回复
感觉楼主是在执行一个这样的操作 :将 amount_compare 与 amount_20140630 的关联结果 插入到 amount_compare 表 ,根据理解意思,完善后的SQL脚本如下 : INSERT INTO amount_compare (custom_count_20140630,amount_20140630,rate_20140630) select customset.custom_count_20140630, customset.amount_20140630 ,customset.rate_20140630 from ( select custom_count as custom_count_20140630,amount as amount_20140630,rate as rate_20140630 from amount_20140630 where amount_compare.ibk_name=amount_20140630.ibk_name ) as customset;
heihei122 2014-08-28
  • 打赏
  • 举报
回复
看不明白楼主的意思
WWWWA 2014-07-25
  • 打赏
  • 举报
回复
INSERT INTO amount_compare (custom_count_20140630,amount_20140630,rate_20140630) select custom_count as custom_count_20140630,amount as amount_20140630,rate as rate_20140630 from amount_20140630,amount_compare where amount_compare.ibk_name=amount_20140630.ibk_name;
benluobo 2014-07-25
  • 打赏
  • 举报
回复
没有这种写法 你可以通过临时表或者存储过程 先查询出满足连接关系的结果,再insert
ACMAIN_CHM 2014-07-25
  • 打赏
  • 举报
回复
楼主到底是要更新还是要插入新记录?!
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

56,940

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧