I have a CartoDB map here:
I'm trying to find the distance of the points to the polygon. If the points are inside, they should have a value of 0. Basically, I'm looking for Near (Analysis) from ArcGIS equiv. in PostGIS http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001q000000
Could someone help me craft out the SQL? I'm trying to learn to do it in PostGIS but figure it's easier to test out the SQL statement in CartoDB.
I've referred to this: http://postgis.net/docs/ST_Distance.html but have had trouble with the syntax on my end.
The points are in a layer called: points_near
The polygon is in a layer called: polygon_near