資料庫名稱: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';