1
當我運行此查詢時,我得到了多個具有相同地址的家庭成員,並且我只希望爲每個家庭/地址分配一行。無法擺脫重複行
SELECT distinct last_name, first_name, address_1, city, state_code, zip_code
from guest
WHERE address_1 IS NOT NULL
GROUP by last_name, first_name, address_1, city, state_code, zip_code
'select distinct'適用於你的字段列表中的所有字段,它不是'select distinct(last_name)',它更像'select distinct(last_name,first_name等) –