Fixed sql query for rent auto population