自己备注
select name,id
from t_user
where point(to_number(longitude, '999.99999999'), to_number(latitude, '999.99999999')) <@ polygon(path('(
(120.03838370529814, 32.17309058339262),
(120.05838225571262, 32.17309058339262),
(120.05838225571262, 32.16558297924396),
(120.03838370529814, 32.16558297924396),
(120.03838370529814, 32.17309058339262)
)'))
AND del_flag = '0'
;
to_number(longitude, '999.99999999')是类型转化,我自己现在的经纬度字段类型是varchar所以转化为float8类型
path下面的经纬度就是框选的经纬度,最后一个经纬度和第一个经纬度形成闭环