plase try the following sql:select a.id from table a, table b where a.condition='a' and b.condition='b' and a.id=b.id

解决方案 »

  1.   

    我还是不明白。能不能请你们详细地说下。我只有一个表,这个表有两个列。哪里来的table a,table b
    只有table a呀。
      

  2.   

    同意 Mybeautiful(天之痕) 的做法.table a / table b 是将同一个表给出两个别名
      

  3.   

    我还是没有弄好。
    select test1.id from test1,test1 where test1.condition='a' and test1.condition='c' and test1.id=test1.id;
    现在报错: Not unique table/alias: 'test1
    我已经在id,condition两个列上分别加了unique索引。
    请问错在哪里?这个用法手册上也找不到。还请各位前辈指点一下。
      

  4.   

    select a.id from test1 a ,test1 b where a.condition='a' and b.condition='c' and a.id=b.id都说清楚了,干嘛要不a,b去掉啊! 
    随便找本简单的SQL语法就知道啥意思了..