tested:Declare @t Table ( ClientKey int, ParentKey int, descStr varchar(20))Insert Into @t Select 1,0, 'Parent 1'Insert Into @t Select 2,0, 'Parent 2'Insert Into @t Select 3,2, 'Child 1 of Parent 2'Insert Into @t Select 4,1, 'Child 1 of Parent 1'Insert Into @t Select 5,2, 'Child 2 of Parent 2'Insert Into @t Select 6,1, 'Child 2 of Parent 1'Select * From @t order by isnull(nullif(parentKey,0),ClientKey), ClientKey
Corey
Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..."