Rafael,
teste este script
CREATE PROCEDURE Media
@tipo VARCHAR(8000)
AS
DECLARE @nota as INT
Declare @t VARCHAR(8000)
SET @t = ( Select ati_pri from Nota where alu_cod = 1 and mat_cod = 3 )
declare @tbArray as table (nota decimal(3,1))
insert into @tbArray
EXEC Split @t
select nota, AVG(nota) media
from @tbArray group by nota
GO
att.
Marcelo Fernandes
MCP, MCDBA, MCSA, MCTS. Se útil, classifique!!!