Quantcast
Channel: Postgresql get rows based on minimum value - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 3

Postgresql get rows based on minimum value

$
0
0

Having this table:

warehouse_iddestination_iddays
112
113
213
214
315
325
122
223

I'd like to get the warehouse_id and daysfor each value of warehouse_id, where the row has the minimum value of days, and destination_id matches a specific value, ordered by days.

For example for destination_id = 1

warehouse_iddays
12
23
35

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>