Skip to content
Advertisement

Oracle SQL Select: getting duplicate results joining tables

I’m starting with SQL and doing some exercises and I’m completely stuck on the last one. It is about looking for streets in the same country name. Two tables are used, locations and countries from the HR schema. The problem is that I don’t know how to avoid duplicate results. For example if I have the street “x” in Canada and the street “y” also in Canada, it shows me twice:

  1. street x / Canada / street y
  2. street y / Canada / street x and I can’t find a way to correct this.

My select is:

I get this Result_

RESULT

Any ideas? Thank you.

Advertisement

Answer

use < instead of <>

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement