select t.* from nametable t inner join addresstable s on t.aid=s.id and t.id='3'select t.* from nametable t left join addresstable s on t.aid=s.id where t.id='3'select t.* from nametable t,addresstable s where t.aid=s.id and t.id='3'我对JOIN的东西不是很熟,就会用WHERE.帮忙看下,最好能推荐一些把WHERE 转为JOIN的例子
select t.* from nametable t inner join addresstable s on t.aid=s.id and t.id='3'select t.* from nametable t left join addresstable s on t.aid=s.id where t.id='3'select t.* from nametable t,addresstable s where t.aid=s.id and t.id='3'我对JOIN的东西不是很熟,就会用WHERE.帮忙看下,最好能推荐一些把WHERE 转为JOIN的例子
t.id s.id为主键
在t.id t.aid s.id上都有索引
select t.* from nametable t inner join addresstable s on t.aid=s.id where t.id='3' 这两个有什么不同啊.