如何在Sqlite数据库中按月搜索 [英] how to search by month in Sqlite database

查看:54
本文介绍了如何在Sqlite数据库中按月搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以做到吗?实际上我使用Android工作室我有下一个代码但不起作用,不显示结果



光标c = db.rawquery(select * from myTable where strftime ('%m',myDate)='07',null);

解决方案

参见 https://www.sqlite.org/lang_datefunc.html [ ^ ]; myDate 应该是日期的字符串值。


there some way to do it? actually i'am using android studio i have the next code but does not work, not display results

Cursor c = db.rawquery("select * from myTable where strftime('%m',myDate)= '07'",null);

解决方案

See https://www.sqlite.org/lang_datefunc.html[^]; myDate should be a string value of a date.


这篇关于如何在Sqlite数据库中按月搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆