易截截图软件、单文件、免安装、纯绿色、仅160KB

MySql 按时间段查询数据方法


格式为2008-06-16
查询出当天数据:
SELECT * from `table` WHERE date(时间字段) = curdate();
查询出当月字段:
SELECT *
from `table`
WHERE month( 时间字段) = month( now( ) ) ;
时间格式为1219876…… UNIX时间,只要应用“from_UNIXTIME( )”函数
例如查询当月:
SELECT *
from `table`
WHERE month( from_unixtime( reg_time ) ) = month( now( ) ) ;
查询上一个月的呢?变通一下!
SELECT *
from `table`
WHERE month( from_unixtime( reg_time ) ) = month( now( ) ) -1;


相关文档:

Mysql Innodb 引擎优化(


参数篇
作/译者:吴炳锡,来源:http://imysql.cn & http://imysql.cn/blog/3208 转载请注明作/译者和出处,并且不能用于商业用途,违者必究。
 
介绍:
  InnoDB给MySQL提供了具有提交,回滚和崩溃恢复能力的事务安全(ACID兼容)存储引擎。InnoDB锁定在行级并且也在SELECT语句提供一个Oracle风格一致 ......

mysql存贮过程

## **********first test,procedure**********
#<1>
use testprocedure;
delimiter //
create procedure simpleproce1 (out par1 int)
begin
 select count(*) into par1 from proce;
end
//
delimiter ;
call simpleproce1(@a);
select @a;
#<2>,每次只有单一的行可以被取回select id,name i ......

如何让mysql支持中文gbk字符集

在mysql数据库中,使用的是latin字符集,所以无法正常的支持中文字符,中文在数据库中显示为乱码“?”号。为了让mysql可以正常使用中文,尤其是当使用jsp连接mysql的时候,我们需要使用gbk的字符集,因此我们要对mysql进行以下设置,以便其有效的支持中文:
IXDBA.NET技术社区
1.修改my.cnf文件
my.cnf文件是 ......

A simple mysql sample

#include <winsock2.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <mysql.h>
#pragma comment(lib,"libmysql")
int _tmain(int argc, _TCHAR* argv[])
{
MYSQL* mysql;
MYSQL_RES* results;
MYSQL_ROW record;
mysql = mysql_init(NULL);
if(! ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号