刚才些漏了,关联的SQL语句为
select t1.id2, t2.v1 from t1,t2
where t1.id1=t2.c1;

解决方案 »

  1.   

    select a.id1,b.v1 from t1 a,t2 b where b.c1=a.id2 and a.id1<>a.id2;
      

  2.   

    不这个意思,我是说t1的ID1和ID2分别相等,比如如下记录
    ID1  ID2  VALUE
    01    09    30
    01    09    40T2中的记录为
    C1   V1
    01   70如何关联得到一条
    ID2   V1
    09    70
    记录,而不是两条
      

  3.   

    试试把 select distinct a.id1,b.v1 from t1 a,t2 b where b.c1=a.id2
      

  4.   

    select a.id2, b.v1 from (select id1,id2 from t1 group by id1,id2) a,t2 b
    where a.id1=b.c1;