K
kylin
I user one table for ProductSort ,and the fields like this-
ID|SortName|Notes|ParentID|
And if the one sort node have a son node ,
I let the son's ParentID=Parent's ID................
Now I input a ID value ,
and first ,I judge if the ID has a son node ,
if has no ,
select * from Product where ProductSortId=@ID,
if has,
judge agin the son node has so node too,
untill there is no son node .
then
select * from Product where ProductSortId=@ID
how can I come true about this In T-SQL ?
ID|SortName|Notes|ParentID|
And if the one sort node have a son node ,
I let the son's ParentID=Parent's ID................
Now I input a ID value ,
and first ,I judge if the ID has a son node ,
if has no ,
select * from Product where ProductSortId=@ID,
if has,
judge agin the son node has so node too,
untill there is no son node .
then
select * from Product where ProductSortId=@ID
how can I come true about this In T-SQL ?