How can I select a field value in PostgreSQL based to the date computation within the table? I have a PostgreSQL table that have these values:

dollar_rate; end_date
------
1. 46.77; 2015-09-16 11:03:03.4082
2. 46.70; 2015-09-17 11:27:00.2446
3. 46.67; 2015-09-17 15:09:15.0354


Now I have this query:

  SELECT dollar_value,end_date-now() from dollar_rate;


The results:

1. 46.77; -04:48:34.945704
2. 46.70; 19:35:21.890696
3. 46.67; 23:17:36.681496


As you can see at the third row, I would like to select this row, that is, the row that contains the highest value with the computation end_date-now(). How can I do this in PostgreSQL?
Sort the result (descending) by the value of end_date - now() and limit to only one row:

SELECT dollar_value, end_date - now() 
from dollar_rate
order by end_date - now() desc
limit 1;


The computation end_date - now() is actually unnecessary in this case, you can simplify this to:

SELECT dollar_value, end_date - now() 
from dollar_rate
order by end_date desc 
limit 1;