I am trying to use st_distance to find the nearest line string to a point. I have two tables in cartodb one is a table of points and the other table is poly lines. To see if I had the logic right I did a st_distance query on the points table from a lat,long point. Everything worked as planned. Then I tried creating a query that would find the closest polygon from a point in my point table.
The error I am getting is this "cross-database references are not implemented: cartodbpoint.the_geom.stdistance" and the query I am trying out is:
MIN(cartodbpoint.the_geom.STDistance(cartodbline.the_geom)) as MinDistance
FROM cartodbpoint, cartodbline
GROUP BY cartodbpoint.cartodb_id
My goal is to get the distance from that point to the nearest line string.