摘要:
UNIX时间戳转换为日期用函数FROM_UNIXTIME()select FROM_UNIXTIME(1156219870);日期转换为UNIX时间戳用函数UNIX_TIMES*****P()Select UNIX_TIMES*****P(’2006-11-04 12:23:00′);例:mysql查询当天的记录数:$sql=”select * from message Where DATE_FORMAT(FROM_UNIXTIME(chattime),’%Y-%m-%d’) = DATE_FORMAT(NOW(),’%Y-%m-%d’) order by id desc”; 阅读全文
摘要:
SQL常用命令使用方法:(1) 数据记录筛选:sql="select * from 数据表 where 字段名=字段值 order by 字段名 [desc]"sql="select * from 数据表 where 字段名 like /'%字段值%/' order by 字段名 [desc]"sql="select top 10 * from 数据表 where 字段名 order by 字段名 [desc]"sql="select * from 数据表 where 字段名 in (/'值1/ 阅读全文