表复制的问题

[复制链接]
查看11 | 回复3 | 2007-9-26 18:42:10 | 显示全部楼层 |阅读模式
xd问些初级问题,谢了
怎么把一张表的内容复制到另一张表,字段是不对应的,比如:
a表
id
chinesetitle
englishtitle
chinesecontent
englishcontent
columnid
b表
id
title
content
classid
现在要把a表的所有记录复制到b表,字段对应如下:
id - id
chinesetitle - title
chinesecontent - content
columnid - classid
如何写这个函数,谢啦
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
insert into b(id,title,content,classid)
select id,chinesetitle ,chinesecontent,columnid
from a;
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
这么简单,谢啦
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
数据类型最好要一致
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行