【发布时间】:2014-03-23 23:21:38
【问题描述】:
我正在尝试使用联合表和现有值填充 MySQL 中的一列。
我有两张桌子 -
__________________________
| papers |
| paperid | title | year |
| 1.0.2 | Awed | 1999 |
_______________________________________
| citations |
| title | year | paperid | refPaperID |
| othP | 1999 | 1.3.4.5 | NULL |
我想在每一行的 citations.refPaperID 列中填入具有匹配 citations.title LIKE pages.title + citations.year = pages.year 的论文行的 paper.paperid。
【问题讨论】:
-
您是要在引文表中插入新行还是确实要更新其中的当前行?
-
更新引文表中的当前行因此对于引文表中的每一行,rePaperID 值指向与引文中具有相同标题和年份的论文的 paperid
标签: mysql database insert sql-insert