- coalesce(null,1) 如果是null 返回1。
- :: 两个冒号用来类型转换
- NUMERIC 数据类型是一种精确数字数据类型,其精度在算术运算后保留到最小有效位
- to_chart(date,‘mm-dd’) 将日期转按一定格式换成字符类型
- to_date(‘2003-10-17 21:15:37’,‘yyyy-mm-dd’) 作用将字符类型按一定格式转化为日期类型
- round(3.333,2) 函数用于把数值字段舍入为指定的小数位数。
- floor()向下舍入为指定小数位数
- ceiling()向上舍入为指定小数位数
- sum(t.count) over() 连续求和
- postgresql extract(epoch from current_timestamp) 获取时间戳
- postgresql generate_series(to_date(‘2013-04-03’,‘yyyy-mm-dd’), to_date(‘2013-04-06’,‘yyyy-mm-dd’), ‘1 day’) 根据时间从小到大,每步一天
- split_part(‘string’, ‘,’ , 1) 根据逗号切割返回切割后的第一位
- substring (‘string’ , 2) 截取string这个字段 从第2个字符开始
- replace(‘string)’, ‘)’ , ‘’) 替换函数,把括号替换成空
- select * from test limit 3 offset 2; 这个SQL是指从第二行的下一行开始向下取3条数据
sql函数总结
于 2022-02-18 13:35:11 首次发布