我正在尝试使用此代码从psql获取结果:
SELECT *
FROM zoho, high_income
WHERE zoho.zip = high_income.zip;
它检索我想要的数据,但是,它会将每个结果打印三次。例如:
John Doe 77808 94912
John Doe 77808 94912
John Doe 77808 94912
Jane Doe 88493 94110
Jane Doe 88493 94110
Jane Doe 88493 94110
我不会在任何一张表中都有三份每份记录。
答案 0 :(得分:0)
试试这个:
SELECT DISTINCT *
FROM zoho, high_income
WHERE zoho.zip = high_income.zip;