select * from A left join B on A.id=B.id
select * from A,B where A.id=B.id
SELECT A.id AS `aid`, A.name AS aname, B .p_id AS pid 、 B.id AS bid 、 B.session AS bsession FROM A,B WHERE A.aid=B.bid
select * from A left join B on A.id=B.id
select * from a left join (select * from b where session='aaa') t on a.id=t.id