不知道你想要怎样啊?select * from tab1 where id not in (select id from tab2)??

解决方案 »

  1.   

    --结果是正确的,你用:select * from tab1 a,tab2 b
    将得到如下结果:id   name id   name 
    ---- ---- ---- ---- 
    0001 23   0001 23
    0002 24   0001 23
    0001 23   0002 24
    0002 24   0002 24(所影响的行数为 4 行)从这个结果来看,第2,3条记录是满足要求a.id<>b.id
    所以:
    select a.id,a.name from tab1 a,tab2 b where a.id <> b.id
    会得到结果:(0001,23)(0001,23)(0002,24)(0002,24)