insert into select not in 2009 年 03 月 20 日2010 年 01 月 18 日蝸牛 如果~要把這個表的資料 補到另一個表去,而且是沒有的才補~ 語法要怎麼下咧~ INSERT INTO Ping (SN) SELECT SN FROM record WHERE SN NOT IN(select SN from Ping); 先把~待補資料的表~全部查出來~ 再比較兩個比~哪些是沒有的~ 最後再完成insert into的動作~ 解析難嗎?不難~但是~我之前只會用php語法和暫存來處理~ Post Views: 187
蝸牛2010 年 01 月 18 日 at 09:16:38Permalink INSERT INTO wp_mail (ID) SELECT ID FROM wp_getinfo WHERE ID NOT IN(select ID from wp_mail) Reply
蝸牛Post author2010 年 01 月 18 日 at 17:56:29Permalink insert into wp_mail_data(ID,Title,Content,Url) select ID,post_title,post_content,to_ping from wp_posts where ID not in (select ID from wp_mail_data); Reply
INSERT INTO wp_mail (ID) SELECT ID FROM wp_getinfo WHERE ID NOT IN(select ID from wp_mail)
insert into wp_mail_data(ID,Title,Content,Url) select ID,post_title,post_content,to_ping from wp_posts where ID not in (select ID from wp_mail_data);