解决方案 »
- 求助!用Java对MySQL压力测试中并发连接>500,数据量>30000时报Communications link failure
- 求教 这句话怎么写
- 您能帮我解决吗?mysql 自表关联 外键约束 插入数据问题
- LOAD DATA is not allowed in stored procedures
- my外键的创建问题
- JDBC连接MySQL出现的错误,希望能有人指点!
- 求救,关于 mysql 安装后运行错误的问题
- 请问以下,我现在要对mysql数据库中的多个表进行初始化数据,该怎么办?
- mysql 远程调用问题!!! 100分
- 请问MYSQL数据库如何增大它的连接数(>100)?
- 很棘手的问题:Access denied for user ''@'localhost' (using password: YES)
- Win7下用VS2010数据库视图连接Linux MySQL服务器的问题
select * from actives where starttime between UNIX_TIMESTAMP() and UNIX_TIMESTAMP() + 3*24*60*60;2,查询starttime大于当前服务器时间,并且在 一周内的结果
select * from actives where starttime between UNIX_TIMESTAMP() and UNIX_TIMESTAMP() + 7*24*60*60;
2,查询starttime大于当前服务器时间,并且在 一月内的结果
select * from actives where starttime between UNIX_TIMESTAMP() and UNIX_TIMESTAMP() + 30*24*60*60;
1,查询starttime大于当前服务器时间,并且在 三天内的结果
select * from actives where starttime > UNIX_TIMESTAMP() + 3*24*60*60+1;
where starttime > UNIX_TIMESTAMP() + 3*24*60*60+1;
这个和你的要求根本不是一会事儿。
mysql> select date_add(now(),interval -1 day);
+---------------------------------+
| date_add(now(),interval -1 day) |
+---------------------------------+
| 2012-07-23 13:20:24 |
+---------------------------------+
1 row in set (0.00 sec)mysql> select date_add(now(),interval -1 week);
+----------------------------------+
| date_add(now(),interval -1 week) |
+----------------------------------+
| 2012-07-17 13:20:29 |
+----------------------------------+
1 row in set (0.00 sec)mysql> select date_add(now(),interval -1 month);
+-----------------------------------+
| date_add(now(),interval -1 month) |
+-----------------------------------+
| 2012-06-24 13:20:32 |
+-----------------------------------+
1 row in set (0.00 sec)