Insert Into tablename(fie1, fie2, fie3, fie4, fie5, fie6, fie7, fie8)
Select fie1, fie2, newvalue, newvalue, newvalue, newvalue, fie7, 
fie8
From tablename
Where fie1 = 'ssss' And fie2 = 'tttt'

解决方案 »

  1.   

    table :testinsert into test select t1.fie1, t1.fie2,'fie3','fie4','fie5','fie6' ,t1.fie7,t1.fie8 
    from test t1 
    where 
    t1.fie1='ssss'
    and 
    t1.fie2='tttt'
      

  2.   

    还有假如说fie3为在原值(原来的fie3)的基础上加1,怎样写,有函数吗?
      

  3.   

    首先,主键字段不能相同:假设主键字段名称为Key,表名Worker
    insert into worker (Key,sex,age)
    select 'new',viewa.sex,viewb.age from 
    (select * from worker where Key='第一条记录主键值') as viewa , (select * from worker where Key='张二条记录主键值') as viewb上述记录添加了一个主键为“new”,使用第一条记录的sex字段,第二条记录的age字段
      

  4.   

    table :testinsert into test select t1.fie1, t1.fie2,t1.fie3+1,'fie4','fie5','fie6' ,t1.fie7,t1.fie8 
    from test t1 
    where 
    t1.fie1='ssss'
    and 
    t1.fie2='tttt'