a数据库多表查询
select
a.id,
a.title,
a.typeid,
b.body,
a.pubdate,
a.keywords,
a.description
from ras_archives a
left join ras_addonarticle b
on a.id=b.aid
where a.typeid = 8
将查询结果插入到新的数据表表中,注意字段的顺序。
insert into cd_content(content_id,title, class_id,detail,create_time,keyword,description) select
a.id,
a.title,
a.typeid,
b.body,
a.pubdate,
a.keywords,
a.description
from `www_wp1_com`.ras_addonarticle a
left join `www_wp1_com`.ras_addonarticle b
on a.id=b.aid
where a.typeid = 9
标签:typeid,表中,addonarticle,ras,联表,sql,id,left From: https://www.cnblogs.com/linuxOS/p/16793954.html