User sql query to sort between start and end letters instead of rails