title: How to find the nearest point Postgis
body: <p>I have two tables in Postgis. Table of plats and table of kindergartens...
  I would like to find the closest kindergraten from the given plat (ogc_fid=1397632) from another table. Both of them are points. I have tried something like that, but it still loading the result, probably something is wrong...</p>
  
  <pre><code>SELECT
    name
  FROM
    kindergarten, plats
  ORDER BY
    ST_Transform(kindergarten.geom,5514) &lt;-&gt;
    (SELECT geom FROM plats where ogc_fid=1397632)
  LIMIT 1;
  </code></pre>
  
  <p>Im not sure if can be a problem that table plats has SRID (Geometry(point,5514)) and table kindergartens has SRID (Geometry(point,3857) Those has been imported from OSM). Does it have some role that SRID is changed in SQL query and not before running them itself?
  Do some of you know where is the problem? Im a beginner in spatial queries...</p>
  
  <p>Thank you very much.</p>