'How to code a query in postgres and show each record when price changes in a series of data
Solution 1:[1]
You can try to use ROW_NUMBER
window function.
SELECT *
FROM (
SELECT *,ROW_NUMBER() OVER(PARTITION BY beast_bid_price ORDER BY posted DESC) rn
FROM T
) t1
WHERE rn = 1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | D-Shih |