日期:2014-05-18  浏览次数:20489 次

如何在一个表中一些字段插入一个查询结果的同时在另一些字段中插入其它的值?
insert   into   pd_biao(pd_id,pd_pdsj,pd_jg)values   (200704240001,20070424,10001)   and(pd_order_id,pd_order_name,pd_order_guige,pd_order_dangwei,pd_order_scdz,pd_order_jhj,pd_kcsl)   select   order_id,order_name,order_guige,order_dangwei,order_scdz,order_jhj,kc_sl   from   kc_biao,order_biao   where   kc_order_id=order_id
这样不行,请高手帮助改一下!

------解决方案--------------------
insert into pd_biao(pd_id,pd_pdsj,pd_jg,pd_order_id,pd_order_name,pd_order_guige,pd_order_dangwei,pd_order_scdz,pd_order_jhj,pd_kcsl)
select 200704240001,20070424,10001,order_id,order_name,order_guige,order_dangwei,order_scdz,order_jhj,kc_sl
from kc_biao,order_biao
where kc_order_id=order_id