Sql Function To Count Number Of Rows