select a.id,b.content from table_1 as a inner join table_2 as b on a.id=b.id 
where a.id=给定的ID

解决方案 »

  1.   

    select a.id,a.name,b.content from table1 as a,from table2 as b
    where a.id=b.id and a.id=id
      

  2.   

    select t1.id,t1.name,t2.content from t1,t2 where t1.id=t2.id
      

  3.   


    select DISTINCT b.content,a.id,a.name from table1 as a left join table2 as b on a.id=b.id where a.id='2'
      

  4.   

    select distinct table_2.content from table_1,table_2 where table_1.id=table_2.id
      

  5.   

    你的表设计有问题,table_1.id和table_2.id是一一对应的话,那你跟据table_1.id直接select table_2.id from table_2 where table_2.id = table_1.id 不就行了吗!二楼应该对啊!select table_1.id, table_2.content from table_1 right join table_2 on table_1.id =table_2.id where table_1.id = table_2.id