title: MySql - Find values that occur AT LEAST two times without using any aggregate function
body: <h2>Table:<strong>City</strong></h2>
  
  <pre><code>City_Name (PK)    State_Name (PK)    Population
  --------------    ---------------    ----------
  Austin            MA
  Austin            TX
  Burlington        VT
  Fresno            CA
  Houston           TX
  Independence      KS
  Independence      MO
  Independence      PA 
  Kansas            CA 
  Kansas            MO
  Paris             MO 
  Paris             OR 
  Paris             TX 
  Paris             VA  
  Paso              TX
  </code></pre>
  
  <p>The above table has a composite primary key (City_Name and State_Name). I want to <strong>find the city which occur in at least two distinct States</strong>. In this case, the result will be</p>
  
  <pre><code>City_Name
  ---------
  Austin
  Independence
  Kansas
  Paris
  </code></pre>
  
  <p>Other cities will not qualify as they don't occur in at-least two states.</p>
  
  <p>This solution is required for practicing relational calculus problems and thus (unfortunately) aggregate function such as COUNT() cannot be used. I went through a database book where I saw a solution to similar problem which looks like this, but not working.</p>
  
  <pre><code>SELECT c1.State_Name FROM City AS c1
  JOIN City AS c2 on c1.City_Name = c2.City_Name AND c1.State_Name = c2.State_Name
  JOIN City AS c3 on c1.City_Name = c3.City_Name AND c1.State_Name = c3.State_Name
  WHERE (c2.City_Name&lt;&gt;c3.City_Name) AND (c2.State_Name&lt;&gt;c3.State_Name);
  </code></pre>
  
  <p>Some help at this point will be highly welcoming.</p>