SQLite在表中显示30分钟的间隔 [英] SQLite display 30 minute intervel in table
问题描述
我有像2011-08-10 12:00:00
这样的表
2011-08-10 12:15:00
2011-08-10 12:30:00
2011-08-10 12:45:00
2011-08-10 01:00:00
2011-08-10 01:15:00
我需要查看日期,例如2011-08-10 12:00:00
2011-08-10 12:30:00
2011-08-10 01:00:00
我需要查询
问候,
Karthick
Hi,
I have Table like 2011-08-10 12:00:00
2011-08-10 12:15:00
2011-08-10 12:30:00
2011-08-10 12:45:00
2011-08-10 01:00:00
2011-08-10 01:15:00
I need to view date like 2011-08-10 12:00:00
2011-08-10 12:30:00
2011-08-10 01:00:00
I need Query
Regards,
Karthick
推荐答案
您的发言是正确的:对不起,我将其与MySQL
混淆了.
更新(这应该与SQLite一起使用):
Your remark is right: I''ve confused it withMySQL
, sorry.
Update (this should work with SQLite):
SELECT mytimestamp FROMA mytable WHERE strftime('%M', mytimestamp) in ('00', '30');
适用于MySQL:
This works with MySQL:
SELECT mytimestamp FROM mytable WHERE MINUTE(mytimestamp) IN (0,30);
这篇关于SQLite在表中显示30分钟的间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!