select a.id,a.name,b.content from table1 as a,from table2 as b where a.id=b.id and a.id=id
select t1.id,t1.name,t2.content from t1,t2 where t1.id=t2.id
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'
select distinct table_2.content from table_1,table_2 where table_1.id=table_2.id
你的表设计有问题,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
where a.id=b.id and a.id=id
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'