说清楚一点
关系是如果表abc中的aa值在100到200之间则cc的值为:001如果表abc中的aa值在200到250之间.则abc中的cc值为002
那表cde用来干什么的

解决方案 »

  1.   

    cde是放一些abc中取值范围的.
    如:
    100到200 为001
    200到250 为002
      

  2.   

    update ABC set cc=(select eee from CDE where ABC.aa>=CDE.ll and ABC.aa<CDE.qq);
      

  3.   

    你的的二张表根本就没有必要存在吗,
    它本来存储的就是动态数据,
    可以直接对表abc进性更改吗、
    直接建一个trigger
    create trigger update_date after insert or update on abc for each row
    begin
    if new.aa>100 and new.aa<=200 then
      cc=001;
    end if;
    if new.aa>200 and new.aa<=250 then
      cc=002;
    end;
    end;
      

  4.   

    有必要的.因为第二张表中有很多条(1万条以上.)哪又应该怎么写呢.谢谢 lhcli(若等闲)