select a.fromstepid,
case a.isauto when 1 then b.tostepid else a.tostepid end as tostepid
from step a
left join step b on fa.tostepid=b.fromstepid
where a.fromstepid not in
(select tostepid from step where isauto=1)
SQL Server2005,测试通过
右键属性..就可以了
具体点!来张图!
是VB安装包吗?附图吧