how to retrieve multiple rows at run time in sql