Here it is :
IF OBJECT_ID(N'tempdb..#pr') IS NOT NULL
drop table #pr
select ID, [type] , name , abs(CHECKSUM(NewId())) rnd into #pr from product
;with a(t , mr) as
(
select type, MAX(rnd) rnd from #pr group by type
)
select p.id, p.type, p.name from a inner join #pr p on a.t = p.type and a.mr = p.rnd
It was impossible to avoid temporary tables because the random field was regenerated in joins and ruined all of my plans so I went for a temporary table.
Good Luck