sql - 有没有办法在 PosgreSQL/PostGIS 中运行一个查询而不是这两个
问题描述
第一个查询是:
SELECT ST_Union(ST_Buffer(geom_kiosk, 250)::geometry(Polygon, 32618)) as geom
FROM tbl_kiosk
WHERE cte = 'ctejeremie'
and status = 'functional' and type = 'public';
第二个查询是:
INSERT INTO tbl_buffer (geom_buffer, distance, cte, date_added)
VALUES(geom, 250,'ctejeremie', now());
谢谢
解决方案
INSERT INTO tbl_buffer (geom_buffer, distance, cte, date_added)
SELECT ST_Union(ST_Buffer(geom_kiosk, 250)::geometry(Polygon, 32618)), '250', 'ctejeremie', NOW()::date
FROM tbl_kiosk
WHERE cte = 'ctejeremie' and status = 'functional' and type = 'private';
推荐阅读
- idris - 尝试为两人游戏键入决策树
- android - Androidx 最小 SDK
- node.js - 即使使用看似正确的处理程序,对我的 App Engine 网站的请求也不会重定向到 HTTPS
- ruby-on-rails - 我需要安装任何特定的生成器,以便设计可以在 ruby on rails 中工作吗?
- java - Java String == 运算符与字符串文字
- javascript - Rails Google Maps Turblinks 在生产模式下不工作
- c++ - 虚幻引擎 - 如何通过 C++ 代码获取 AxisMappings
- docker - docker-compose:EXPOSE 在主机端口或容器端口上起作用吗?
- javascript - 如何使用索引在 Vuejs (vuetify) 中仅选择一个扩展面板?
- bash - 排序命令(MacOS 终端)给出不一致的结果