It's bad...I know-- generate some test datadeclare @M table (Mid int)declare @Q table (Qid int, Mid int, QValue varchar(255))insert @Mselect 1 union all select 2insert @Qselect 10,1,'Q10 value' union allselect 11,1,'Q11 value' union allselect 12,1,'Q12 value' union allselect 20,2,'Q20 value' union allselect 21,2,'Q21 value'-- classic inner join resultset...selectconvert(varchar(255),m.Mid) as Mid,q.QValuefrom @M as minner join @Q as q on m.Mid = q.Midorder by m.Mid,q.Qid-- resultset without repeating Master dataselect case when rownum=1 then Mid else '' end as newMid,QValuefrom(selectrow_number() over (partition by m.Mid order by m.Mid) as rownum,convert(varchar(255),m.Mid) as Mid,q.QValue,q.Qidfrom @M as minner join @Q as q on m.Mid = q.Mid)dtorder by Mid,Qid
No, you're never too old to Yak'n'Roll if you're too young to die.