1
應刪除稍後出現的所有重複項(在此情況下排序爲rational
)。但以下查詢不起作用:Postgresql不同於優先級
SELECT DISTINCT ON(postcards.id) postcards.id, postcards.title, rational
FROM
(
SELECT postcards.id, postcards.title,
some_complex_condition as rational
FROM postcards
ORDER BY rational
) as postcards
我希望它取決於排序,但它不。似乎需要設置一些優先DISTINCT ON
。 Postgresql
可以嗎?
非常感謝! – tiktak