Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想最终生成月度和年度报告。
假设我有一个包含(price, date, ...)的表事务,我想生成一个按 分组的报告。 month
month
我应该将日期存储为 3 个单独的字段日、月和年吗?或者我可以将它存储为数据类型的日期?Date
Date
如果是date,查询是什么样的以及如何在 iOS 中实现它?
注意:我是 iOS 新手
提前致谢。
在数据库中,您应该始终希望将日期存储为日期,而不是它们的组成字段。
SQLite 提供了各种用于操作和排序日期的函数,因此您可以使用它们。
取消日期的月份非常容易。
使用date.
date