title: How can I order by date before self joining a table
body: <p>How can I order my results by date_added descending in the whole table before searching for equal_listings in my query down below? Now when I try to order it leaves me hanging.</p>
  <pre><code>SELECT objects_2.created_at, objects_2.uuid, objects_2.price, objects_2.address, objects_2.square_meters,
      ARRAY(SELECT ROW(created_at, square_meters, uuid, price, address) 
            FROM objects 
            WHERE uuid != objects_2.uuid 
            AND floor = objects_2.floor 
            AND square_meters = objects_2.square_meters
            AND latitude &gt;= (objects_2.latitude - (0.03 * (360 / (cos(objects_2.latitude) * 40075))))
            AND latitude &lt;= (objects_2.latitude + (0.03 * (360 / (cos(objects_2.latitude) * 40075))))
            AND longitude &gt;= (objects_2.longitude - (0.03 * (360 / (cos(objects_2.longitude) * 40075))))
            AND longitude &lt;= (objects_2.longitude + (0.03 * (360 / (cos(objects_2.longitude) * 40075))))
            AND CASE 
                  WHEN square_meters IS NOT NULL 
                  THEN square_meters = objects_2.square_meters 
                END)
      AS equal_listings 
  FROM objects objects_1, objects objects_2
  WHERE objects_2.square_meters != 0
  ORDER BY objects_2.date_added DESC &lt;--- this leaves me hanging with no response
  LIMIT 30;
  </code></pre>