title: Combining "like" rows
body: <p>I have a table of locations_from, locations_to, and count of flights.  I want to combine the rows where departure on one row equals arrival on the other (for example LA TO NY combined with NY TO LA) and SUM the like rows.</p>
  
  <p>I think it would be better explained with an example.</p>
  
  <p><strong>BEFORE</strong>  </p>
  
  <pre><code>locations_from      locations_to      # of Flights
  --------------------------------------------------
  San Francisco, CA   Los Angeles, CA     29558
  Los Angeles, CA     San Francisco, CA   32389
  New York, NY        Los Angeles, CA     30389
  Los Angeles, CA     New York, NY        35484
  Las Vegas, NV       Los Angeles, CA     28363
  Los Angeles, CA     Las Vegas, NV       34455
  Honolulu, HI        Kahului, HI         46563
  Kahului, HI         Honolulu, HI        16879
  San Francisco, CA   New York, NY        44654
  New York, NY        San Francisco, CA   25882
  </code></pre>
  
  <p><strong>AFTER</strong>  </p>
  
  <pre><code>From/To             From/To           # of Flights
  ---------------------------------------------------
  San Francisco, CA   Los Angeles, CA      61947
  New York, NY        Los Angeles, CA      65873
  Las Vegas, NV       Los Angeles, CA      62818
  Honolulu, HI        Kahului, HI          63442
  San Francisco, CA   New York, NY         70536
  </code></pre>
  
  <p>I have tried a cross join on itself </p>
  
  <pre><code>where a.locations_from = b.locations_to
  </code></pre>
  
  <p>this works but I end up getting double the rows (IE one for LA TO NY and also one for NY TO LA)</p>