fetch last n rows in a table