看板 Database 關於我們 聯絡資訊
資料庫名稱:MySQL 內容/問題描述:您好我是初學者,想知道下面兩個語法的結果是一樣的嗎? 謝謝! SELECT COUNT(DISTINCT pid) AS Hispanic FROM (SELECT patients.pid, patients.ethnicity, ethnicity.Name, ethnicity.Code FROM ethnicity INNER JOIN patients ON patients.ethnicity=ethnicity.Code) WHERE Name='Hispanic or Latino'; SELECT COUNT(DISTINCT patients.pid) AS Hispanic FROM ethnicity, patients WHERE patients.ethnicity=ethnicity.Code AND ethnicity.Name='Hispanic or Latino'; -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 69.143.188.208 ※ 文章網址: https://www.ptt.cc/bbs/Database/M.1466133181.A.24E.html
Ammenze: 應該是一樣的 06/17 12:19
evilove: 謝謝您~ 06/17 23:16