android sqlite3 sql语句之 根据时间段 查询
来源:互联网 发布:昆明知行素质教育中心 编辑:程序博客网 时间:2024/06/08 00:53
知识点:
1.时间格式
public static SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd");
long nowMills=System.currentTimeMillis();
String endTime=DataTool.sdf3.format(nowMills);
1.查询前10条记录,根据 字段 排序
select * from table where .... order by XX desc limit 0,10;
2.根据 时间日期 查询 :
注意时间格式必须是 2016-02-02
startTime="2016-02-02";
endTime="2016-03-04";
数据库中: birthdayDate 生日列名
String sql="select * from person where datetime(birthdayDate) between datetime('"
+startTime+"') and datetime('"+endTime+"')";
3.改-更新数据
String sql="update tableName set 列名 = '"
+ issue[7]+ "',lx = 'hf' where reportID = '"
+ issue[0]+ "' ";
4.增-新增数据
String sql="insert into qshf (reportID,reportTitle,reportContent,createTime,receiveContent,lx )values('"
+ issue[0]+ "','"
+ issue[1]+ "','"
+ issue[2]+ "','"
+ newFormatTime+ "','"
+ issue[7]
+ "','hf' )";
注意:sql="select * from qshf where createTime between '2017-02-10' and '2017-02-13'";
最佳
- android sqlite3 sql语句之 根据时间段 查询
- mybatis查询时间段sql语句
- mybatis查询时间段sql语句
- mybatis查询时间段sql语句
- mybatis查询时间段sql语句
- mybatis查询时间段sql语句
- mybatis查询时间段sql语句
- 一个查询每天时间段的SQL 语句
- 时间段查询SQL语句[WEB学习示例]
- sql语句中时间段查询格式
- SQL查询时间段的语句写法
- mysql中sql时间段查询语句
- mybatis查询时间段sql语句和DATE_FORMAT
- mysql的hql语句之时间段查询
- linux之根据时间段查询目录底下文件名
- Oracle实现查询时间段的Sql语句两法
- mysql where 查询在某个时间段内的sql语句
- 根据时间段去做查询条件
- 知名互联网公司网站架构图
- 常用工具页面
- CSS下拉菜单
- 2009 Multi-University Training Contest 5 - Host by NUDT
- java 同步原理
- android sqlite3 sql语句之 根据时间段 查询
- 大数据_Storm_cluster模式下storm kill topology时做cleanup的解决方法
- [51nod 1667]概率好题
- bzoj1770[Usaco2009 Nov]lights 燈
- listView常见小问题
- 关于动态创建input checkbox的应用
- requests和BeautifulSoup组合爬虫技术
- 四种生成和解析XML文档的方法详解(介绍+优缺点比较+示例)
- TCP/IP、Http、Socket的区别