Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 什么';这是正确和优化的方法;分组方式;及;“最大值”;或;最近的;使用ORMLite的值?_Java_Android_Sqlite_Ormlite - Fatal编程技术网

Java 什么';这是正确和优化的方法;分组方式;及;“最大值”;或;最近的;使用ORMLite的值?

Java 什么';这是正确和优化的方法;分组方式;及;“最大值”;或;最近的;使用ORMLite的值?,java,android,sqlite,ormlite,Java,Android,Sqlite,Ormlite,“分组依据”和“最大”或“最新”字段值的正确和最优化方式是什么?(最好使用ORMLite) 我想要“分组依据”结果,但要从日期类型的字段中获取最新的值 比如: -- records: 1, hello, 1985 2, hello, 1991 3, hello, 1990 4, hello world, 2015 5, hello world, 2010 6, hello world, 2000 运行query/ormlite函数后,我应该得到如下结果: -- grouping by str

“分组依据”和“最大”或“最新”字段值的正确和最优化方式是什么?(最好使用ORMLite)

我想要“分组依据”结果,但要从日期类型的字段中获取最新的值

比如:

-- records:

1, hello, 1985
2, hello, 1991
3, hello, 1990
4, hello world, 2015
5, hello world, 2010
6, hello world, 2000
运行query/ormlite函数后,我应该得到如下结果:

-- grouping by string field (column 2) 
-- and the most recent value of year (column 3)
-- so results should be like this:

2, hello, 1991
4, hello world, 2015

此区域的文档比较少,但如果使用ORMLite进行聚合,则可能需要使用queryRaw(),请参见我的回答:此区域的文档比较少,但如果使用ORMLite进行聚合,则可能需要使用queryRaw(),请参见我的回答: