SQL select two nearly fields

select, sql

Solution

SELECT * 
FROM wp_weather
WHERE city = 'Махачкала'
order by abs(timestamp - 1385435000) 
limit 2

Problem

How do I select two most nearly fields to specific timestamp? ``` SELECT * FROM 'wp_weather' WHERE ( timestamp most nearly to 1385435000) AND city = 'Махачкала' ``` The table: ``` id | timestamp --------------- 0 | 1385410000 1 | 1385420000 2 | 1385430000 3 | 1385440000 4 | 1385450000 ```

Original source