我正在尝试使用 sqlkorma 调用此函数的等效项,但在文档(http://sqlkorma.com/docs)中没有找到等效的分区:
SELECT * FROM (
SELECT DISTINCT cgi, scgi, c.id, c.name, c.address, c.city,
c.state_or_province, c.postal_code, primary_country,
ROW_NUMBER() OVER (
PARTITION BY cgi
) AS ROW_NUMBER
from ccs
join c on c.id = ccs.id) groups
WHERE groups.ROW_NUMBER = 1 ORDER BY cgi
为了清楚起见,在我的数据库中,有一个一对多的关系列变量“cgi”和“c.id”