从SQLite的列中删除特定的字符串

时间:2019-06-17 07:58:01

标签: sql sqlite

我的列(time_stamp)在单列中包含DATE和TIME。我想删除TIME,然后就可以根据日期对记录进行分组。但我不知道如何仅从下面的列中删除时间。 查询

delete time_stamp from table1  // deletes whole column but I just want to delete time not date from column.
time_stamp
 2018-09-01 05:02:08
 2018-09-01 05:05:21
 2018-09-01 05:12:08
 2018-09-01 05:22:08

有可能吗?

2 个答案:

答案 0 :(得分:1)

尝试

[64.0, 66.0, 53.5, 52.1, 54.0] [84.0, 86.0, 63.5, 72.1, 24.0]
[54.0, 56.0, 23.5, 32.1, 84.0] [24.0, 26.0, 63.5, 92.1, 84.0]

答案 1 :(得分:0)

您可以在group by子句中使用date()substr()

group by date(time_stamp)

group by substr(time_stamp, 1, 10)