SQLite在表中显示30分钟的间隔

SQLite在表中显示30分钟的间隔

本文介绍了SQLite在表中显示30分钟的间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有像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

推荐答案

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分钟的间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 03:44