We\'re working with some financial data and need to select trades in specific order, which also depends on type of trades (BUY or SELL). We are using PostgreSQL 12 with Timescal