您的当前位置:首页 > 最新IT资讯
最新资讯
[postgresql] postgresql当前时间
Postgresql 当中有四种方式获取当前时间。一:now() 通过now()获取的时间是最完整的时间,包括时区,秒也保留到了6位小数。 select now(); 得到的结果如下 '2014-12-24 09:28:31.545145+08'二:current_timestamp效果是和now()一样的。三:current_time 只显示当前的时间,不包括日期 ...
[] 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...
[MySQL] MySQL 之 创建千万数据测试
-- MySQL测试任务:使用存储过程,往表中插入千万级数据,根据索引优化速度-- 1.使用索引查询-- 2.不使用索引查-- 3.比较两者查询速度的差异1.创建数据和索引1.创建索引测试表1234567DROP TABLE IF EXISTS big_data;CREATE TABLE big_data(idintPRIMARY KEY NOT NULL AUTO_INCREMENT,name ...
[] 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...
[MySQL] mysql函数-时间操作
3、时期时间函数dayofweek(date)返回日期date是星期几(1=星期天,2=星期一,……7=星期六,odbc标准)mysql> select dayofweek('1998-02-03'); -> 3weekday(date)返回日期date是星期几(0=星期一,1=星期二,……6= 星期天)。mysql> select weekday('1...
[MySQL] mysql函数-数字操作
2、数学函数abs(n)返回n的绝对值mysql> select abs(2); -> 2mysql> select abs(-32); -> 32sign(n)返回参数的符号(为-1、0或1)mysql> select sign(-32); -> -1mysql> select sign(0); -> 0mysql> select s...
[MySQL] mysql函数-字符串操作
concat用于字符串拼接,也可拼接字段等,
[postgresql] Postgresql的字符串操作函数
函数:string || string 说明:String concatenation 字符串连接操作例子:'Post' || 'greSQL' = PostgreSQL函数:string || non-string or non-string || string说明:String concatenation with one non-string input 字符...
[postgresql] postgresql数据库多对多数据库设计与查询,行列互换
数据库中我们遇到很多多对多的问题,有兴趣的可以看一下