SQL Server 2008 地理 - 空间结果 - 基于另一个列值的颜色
我在 SQL Server 2008 中有一个这样的表:
serv_type coords
------------------------
shop 0xE6100000010CE4857478080B49401CD2A8C0C9DE2C40
shop 0xE6100000010C54C6BFCFB80A49408A592F8672DA2C40
restaurant 0xE6100000010C2A00C63368064940B5C189E8D7162D40
shop 0xE6100000010CF9F884ECBC0B49405D6A847EA6FE2C40
restaurant 0xE6100000010CD3BEB9BF7A004940BC202235EDF22C40
restaurant 0xE6100000010CEE76BD3445004940508D976E12F32C40
restaurant 0xE6100000010CFFAECF9CF50B49400ABDFE243EE72C40
... ...
如果我SELECT * FROM this_table
,我会自动获取空间结果 - 类似于地图上的点。
我想要得到的是完全相同的东西,但是根据 serv_type
列对点进行着色,即,我想要相同的“地图”,但所有餐厅都应该是蓝色和所有商店都应该是红色的。
在 SQL Server 中可以做到这一点吗? 谢谢。
I have a table like this in SQL Server 2008:
serv_type coords
------------------------
shop 0xE6100000010CE4857478080B49401CD2A8C0C9DE2C40
shop 0xE6100000010C54C6BFCFB80A49408A592F8672DA2C40
restaurant 0xE6100000010C2A00C63368064940B5C189E8D7162D40
shop 0xE6100000010CF9F884ECBC0B49405D6A847EA6FE2C40
restaurant 0xE6100000010CD3BEB9BF7A004940BC202235EDF22C40
restaurant 0xE6100000010CEE76BD3445004940508D976E12F32C40
restaurant 0xE6100000010CFFAECF9CF50B49400ABDFE243EE72C40
... ...
If I SELECT * FROM this_table
, I automatically obtain spatial results - something like points on a map.
What I would like to get is the very same thing, but with the points colored based on the serv_type
column, i.e., I want the same "map", but all restaurants should be, say, blue and all shops should be red.
Is it possible to do this in SQL Server?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SQL Server 只会为您提供数据。如果您想根据数据的属性格式化该数据以进行演示,则必须构建一个包含演示逻辑的 UI。
SQL Server is only going to give you the data. If you want to format that data for presentation according to attributes of that data, you're going to have to build a UI which contains your presentation logic.