Quantcast
Viewing latest article 3
Browse Latest Browse All 3

Postgresql get rows based on minimum value

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 latest article 3
Browse Latest Browse All 3

Trending Articles