+---abc-----    
   ----A1 
   ----A2 
其中,abc,与A1,A2的分组号相同为 idgro要求,abc类别属于表  table1     A1,A2类别属于表table2 
Table1与table2都有一个字段 name(诊断),  点abc时,弹出:       要填入的内容!!!   操作过程:填入内容后点保存            
                       保存 
   
问题: 当选择abc填入内容点”保存”, 这时要使 A1,A2字段的内容也都变为 abc 保存的内容??? 

解决方案 »

  1.   

    --sql server
    --1
    update table2
    set A1 = table1.abc,
        A2 = table2.abc
    from table2,table1
    where table2.name = table1.name
    --2
    update table2
    set A1 = (select abc from table1 where name = table2.name),
        A2 = (select abc from table1 where name = table2.name)
    from table2--oracleupdate table2
    set A1 = (select abc from table1 where name = table2.name),
        A2 = (select abc from table1 where name = table2.name)