結果 : sql function to return number of rows