-1

I am trying to get results from psql with this code:

SELECT * 
FROM zoho, high_income 
WHERE zoho.zip = high_income.zip;

It retrieves that data that I want, however, it prints every result three times. For example:

John Doe 77808 94912
John Doe 77808 94912
John Doe 77808 94912
Jane Doe 88493 94110
Jane Doe 88493 94110
Jane Doe 88493 94110

I don't have three copies of each record in either table.

tay_thomp
  • 245
  • 2
  • 12
  • 2
    Possible duplicate of [How to select unique records by SQL](http://stackoverflow.com/questions/1641718/how-to-select-unique-records-by-sql) – Holger Just Jun 24 '16 at 23:19

1 Answers1

0

try this :

SELECT DISTINCT *
FROM zoho, high_income 
WHERE zoho.zip = high_income.zip;
Merve Sahin
  • 1,008
  • 2
  • 14
  • 26