看板 Database 關於我們 聯絡資訊
※ 引述《BigLoser (大魯蛇)》之銘言: : 資料庫名稱:mssql : 內容/問題描述: : table1 talbe2 : id a b c d : 1 01 02 01 小明 : 2 02 02 02 小華 : 希望可以一段sql指令可以 : select table1.a, table1.b from table where id=1 : 得到結果 : a b : 小明 小華 : 請問該怎麼下,謝謝 select (select d from table2 where c=a) a, (select d from table2 where c=b) b from table1 阿......好爛的方法XD .... 不知MSSQL有無支援這種query -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 203.65.163.29 ※ 文章網址: http://www.ptt.cc/bbs/Database/M.1403604221.A.1AD.html ※ 編輯: bohei (203.65.163.29), 06/24/2014 18:12:50