比方说,我有如下表:选择从表(MS SQL Server中,SQLite的)最新版本
ID | UID | Version | Content
---+-----+---------+-----------------------------
1 | 1 | 1 | Something
2 | 1 | 2 | Something (changed)
3 | 2 | 1 | Alice has a cat
4 | 2 | 2 | Alice has a cat and a dog
5 | 2 | 3 | Alice has a cat and a canary
我需要创建查询,这将返回所有对象,但只有最新版本,所以在这种情况下:
ID | UID | Version | Content
---+-----+---------+-----------------------------
2 | 1 | 2 | Something (changed)
5 | 2 | 3 | Alice has a cat and a canary
由于SQL方言不同,我会运行MS SQL Server 2008上的这个查询的SQLite 3
我怎样才能做到这一点?