----插入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
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
insert into b select * from a where uid not in (select uid from b)余下的问题没看明白 :(
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
insert into b select a.uid from a M where not exists (select 1 from b where uid=M.uid)--下面不太明白!
B表有许多,名字不固定,根据不同的情况给出不同的表名,也可以通过查询C表得出。
要求返回UID,以及A表,B表的其它所有字段的值
然而,B表的表名也存在于另一表内: C表。C表通过一个ID号可以从字段TableName来得到B表的表名