其中的几何列的col in()子句在mysql中 [英] where col in() clause for geometry column in mysql

查看:117
本文介绍了其中的几何列的col in()子句在mysql中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  id asText(latlng)

1 POINT(35.80684 51.427820000000004)

2点(35.726940000000006 51.30407)

3点(35.726940000000006 51.30407 )

4点(35.726940000000006 51.30407)

5点(35.72343 51.303200000000004)

6点(35.72675 51.303760000000004)

现在,我想通过给出POINT列表来选择并查找某些记录,并希望在SQL语法中使用WHERE in 。

但是这个查询不起作用:

  SELECT id, astext(latlng)FROM`points` WHERE latlng in(POINT(35.80684 51.427820000000004))

任何人都可以帮忙我解决我的问题?

谢谢 解决方案

试试这个: -

  SELECT id,asText(la tlng)FROM`points` WHERE asText(latlng)in('POINT(35.80684 51.427820000000004)')


i have a table with geometry(point) column data type, i stored data as POINT Object in mysql like this :

id      asText(latlng)

1   POINT(35.80684 51.427820000000004)

2   POINT(35.726940000000006 51.30407)

3   POINT(35.726940000000006 51.30407)

4   POINT(35.726940000000006 51.30407)

5   POINT(35.72343 51.303200000000004)

6   POINT(35.72675 51.303760000000004)

Now, i want to select and find some records by giving a list of POINTs and wants to use WHERE in() clause in sql syntax.

But this query is not working :

SELECT id, asText(latlng) FROM `points` WHERE latlng in (POINT(35.80684 51.427820000000004))

anybody can help me to resolve my problem?

thanks

解决方案

Try this:-

SELECT id, asText(latlng) FROM `points` WHERE asText(latlng) in ('POINT(35.80684 51.427820000000004)')

这篇关于其中的几何列的col in()子句在mysql中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆