postgresql: Fix SQL query for origin_find_visit_by_date method
In that query, the interval alias was set for the visit column instead of the date difference computation which could lead to wrong visit being returned due to invalid results ordering.
Migrated from D8347 (view on Phabricator)