Use single SQL query for getting original locations