Postgresql – Fetch first X rows from a sorted result in subquery
I want to select only those identifiers from a table which are contained in another subquery result and only top-2 rows must be used. For example you can run the query on PG: select a.rid from( values (41), (42), (43),…