问题我觉得表达的很不清楚,我先试着回答1,看看楼主的问题意思
select * from tb2 where Fdept ='开发部'
union
select *,null,null from tb1 where Fdept ='开发部'

解决方案 »

  1.   

    yujohny(踏网无痕) 的回答应该是正确的,只是这种数据结果楼主觉得有什么意义吗第二、三条请使用级联删除和级联更改就可以了,需要为tb2建立外键
      

  2.   

    yujohny(踏网无痕) 的回答应该是正确的,只是这种数据结果楼主觉得有什么意义吗第二、三条请使用级联删除和级联更改就可以了,需要为tb2建立外键
      

  3.   

    是主從表:
    (1)select t1.*,t2.* from tb1 t1(nolock),tb2 t2(nolock)
    where t1.Fid=t2.Fid
    and t1.Fdep=t2.Fdep
    and t1.Fdep='开发部'
    (2)(3)在觫發器中完成
      

  4.   

    (1)select A.*,B.* from tb1 A,tb2 B
    where A.Fid=B.Fid
    and A.Fdep=B.Fdep
    and A.Fdep='开发部'
    (2)delete tb2 where Fdep='开发部'  delete tb1 where Fdep='开发部'  
    (3)可以使用一个触发器来自动完成更新。
      

  5.   

    select * from tb1 where Fdept="開發部"
    union all
    select * from tb2 where Fdept="開發部"delete tb1 where Fdept="開發部"
    delete tb2 where Fdept="開發部"update tb1 set Fdept="技術部" where Fdept="開發部"
    update tb2 set Fdept="技術部" where Fdept="開發部"
      

  6.   

    主从关系表,如果没有设置好级联删除、级联更新,删除和修改时,用一条语句可以同时修改这两个个主从吗?好像没有一次可delete两个表的语句的。
      

  7.   

    delete from tb1 ,tb2 where Fdept = '开发部'
      

  8.   

    有一个表:student字段:id,chengji(成绩)查询出来:成绩相等的学生的id.以下列方式显示:1,2,3   80
    12,13    85没有重复的不显示,五十分钟!!!!!!!!!!!!!!
      

  9.   

    1 .select * from tb1 where Fdept ='开发部' union
      select * ,null,null from tb2 where Fdept ='开发部'
    2.create trigger tri_up 
    on tb1
    for delete
    as 
    begin
    delete tb2  where tb2.dept='开发部'
    end
    go
    delete tb1 where dept='开发部'
    3  create trigger tri_up 
    on tb1
    for update
    as 
    begin
    update  tb2 set  dept='技术部'where tb2.dept='开发部'
    end
    update tb1 set dept='技术部'where tb1.dept='开发部'