title: Postgis calculate the distance between points
body: <p>I have a table that has more than 15k rows.</p>
  
  <p>The table has locationID, isEmpty, longitude and latitude fields.</p>
  
  <p>I want to calculate the distance between each point has isEmpty field = 1 and the others and insert the result into new table using Postgis.</p>
  
  <p>Please advise what is the best practice for writing sql statement executing this requirement</p>