sql问题:从一个视图获取数据并插入到新表中(非临时表)

表 district 字段 id,sheng,city,traffic,tips,shop,introduction,hotel,holiday,history,highlight,entertainment,climate,dish视图 vdisall 字段相同

因为我实在有点弄不懂你下面的补充,所以就回答一下操作方法,希望会对你有所帮助
(1)从一个视图获取数据并存入一个新表中:(表原先不存在)
select 要获取的数据 from 视图名 [ where 条件](条件可要可不要) into table 表名
(2)从一个视图获取数据并插入一个新表中:(表原先已存在)--------要先把查到的数据放到一个数组中,再将值插入到表中
select 要获取的数据 from 视图名 [where 条件](条件可要可不要) into array tmp
insert into 表名 values(tmp(n,n)……)
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-03-31
insert into district select * from vdisall where 条件 一楼的肯定执行不过去,as不应该出现在insert into语句中的
第2个回答  2013-03-30
insert into district
select id,sheng,city,traffic,tips,shop,introduction,hotel,holiday,history,highlight,entertainment,climate,dish from vdisall
相似回答