dswsl2016 2012-09-29 19:52
浏览 10
已采纳

在一个id中保存一个变量的1个以上数据

I crawled a web, for example I crawled to get the authors ($author) and the link of authors. For one id, sometime, there are 2 authors, and when I save them in database, they will be separated in different id,

for example : I get $author and $link = string(14) "Aaron M. Cohen" string(73) "http://example.com/Author/4279758" string(16) "William R. Hersh" string(68) "http://example.com/Author/299122"

===========================================================
|id|web|      author    |            author_link          |
===========================================================
|1 | A |Aaron M. Cohen  |http://example.com/Author/4279758|
|2 | A |William R. Hersh|http://example.com/Author/299122 |
===========================================================

Is it possible to save them in one same id? How? thank you in advance :) fyi, I wanna save them in one id, because of the next process is I want to inner join the table with other table that have same web. If there are two id in same web, they will be printed twice.

  • 写回答

1条回答 默认 最新

  • doutang7414 2012-09-29 19:56
    关注

    No. Create another table that actually contains the author and a fkey to the id in order to keep the database in first normal form.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题