I have a created a table named city in my database. This table has 2 columns, called 'name' and 'country'. I have created a query that returns the combinations of cities from different countries which is below:
SELECT c1.name, c1.country, c2.name, c2.country
FROM city c1, city c2
WHERE c1.country != c2.country
This query works, but however the city pairs are repeated ie. I get results with:
Berlin Germany London England
London England Berlin Germany
which means that the city pair berlin/hamburg is repeated in my result set. Is there a way around this?