表1表名为 news有字段: id title dateline
表2表名为 date有字段: id nid content
其中 表2中的nid 和表1中的 id是关联的现在想生成一个全新的数据表 tt
内有字段 id title content dateline 请问 要如何操作数据库呢?求操作语句多谢了
表2表名为 date有字段: id nid content
其中 表2中的nid 和表1中的 id是关联的现在想生成一个全新的数据表 tt
内有字段 id title content dateline 请问 要如何操作数据库呢?求操作语句多谢了
我先看下 是我说的有问题
应该是以 news表为基础
把date表中的 content字段 加到 news就行
select a.*,b.content from news a left join `date` b on a.id=b.nid