[] postgresql空间函数
http://www.cnblogs.com/ytwy/p/6826549.htmlWKT定义几何对象格式:POINT(0 0) ——点LINESTRING(0 0,1 1,1 2) ——线POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1)) ——面MULTIPOINT(0 0,1 2) ——多点MULTILINESTRING((0 0,1...
[] mysql按周,月,日,年统计数据
<!-- 按日查询 -->SELECT DATE_FORMAT(created_date,'%Y-%m-%d') as time,sum(money) money FROM o_finance_detail where org_id = 1000 GROUP BY time<!-- 按月查询 -->SELECT DATE_FORMAT(created_dat...
[] postgresql统计年月日
posqgresql--按年分组查看 select to_char(time_field, 'YYYY') as d , count(id) as total_count,sum (count_field) as total_amount from table_name where time_field between start_time and end_time group b...
[] sql对查询为null的值赋默认值
sql对查询为null的值赋默认值后台开发中经常需要给前端提供接口,返回的字段为null的时候需要设置字段的默认值。针对不同的数据库实现方式有:sqlserver:Sql代码selectisnull(字段,0)from表名--这样就是把空值赋值为0MySQL:Sql代码selectifnull(字段,0)from表名oracle:Sql代码selectnvl(字段,0)from表名postgiss...
[] sql语句拼接字符串
不同的数据库,相应的字符串拼接方式不同,通过对比加深一下记忆。一、MySQL字符串拼接1、CONCAT函数语法格式:CONCAT(char c1, char c2, ..., char cn) ,其中char代表字符串,定长与不定长均可以连接两个字符串连接多个字符串2、"+"操作符连接两个字符串 连接多个字符串3、假如其中一个字段为NULL,则用结果用空格代替NULL。 二、O...
[] postgissql抽稀数据
SELECT ST_Multi(ST_SimplifyPreserveTopology(geom ,10)) from area_city where 1=1;...