--insert tableB
insert into B select * from A where not exists (select * from B where uid=A.uid)
--query
select a.*,b.* from a inner join b on a.uid=b.uid
----插入b表不存在的﹕
insert into b select a.uid from a left join b on a.uid=b.uid where b.uid is null
---查詢A,B所有字段的值。
select a.*,b.* from a inner join b on a.uid=b.uid