看板 Database 關於我們 聯絡資訊
使用 moyasi 在原推文裡提到的方法: minus select a1,b1 from a cross join b except -- sql server 裡叫 except select c1,c2 from c ※ 引述《oherman (qq)》之銘言: : 資料庫名稱:sql2016 : 資料庫版本: : 內容/問題描述: : table a : 資料schema如下: : a1 : ========= : a : b : c : table b : 資料、schema如下: : b1 : ========= : 1 : 2 : 3 : table c : 資料如下: : c1 c2 : ========= : a 1 : b 2 : c 2 : 想將a、b結合為一新資料如下 : a1 b1 : =========== : a 1 : a 2 : a 3 : b 1 : b 2 : b 3 : c 1 : c 2 : c 3 : 請問想將結合的資料與c table判斷,a1<>c1且b1<>c2的 : 資料insert至c table的sql語法要如何下,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.223.53.159 ※ 文章網址: https://www.ptt.cc/bbs/Database/M.1535693883.A.3B9.html
oherman: 謝謝c大,請問select a1,b1 from a cross join b這段語句 08/31 13:55
oherman: 後面加where 條件再minus語句會錯誤要如何做? 08/31 13:56
※ 編輯: cutekid (61.223.53.159), 08/31/2018 15:28:36