http://topic.csdn.net/u/20100515/17/02ba7650-e32d-40e9-90c6-afda0efd2e40.html?seed=1635730994&r=65479377#r_65479377 到处求救~~ 希望能解决下,只剩下这么点分了。递归查询,要用VBA来实现 Select t.* from T_Kind t,T_P p where t.K_ID = p.P_Kind
不是你想要的结果吗?如果不是,那你想要的结果是什么样? SQL code:
create table T_K ( K_ID int identity(1,1) primary key not null, K_Name varchar(30), K_Kind int default 0 )
select * from T_Kind
insert into t_k(K_Name)values('球') insert into t_k(K_Name,K_Kind)values('篮球','1') insert into t_k(K_Name,K_Kind)values('足球','1') insert into t_k(K_Name)values('人')
insert into t_p(P_Name,P_Kind,P_Image,P_Content,P_AddDate)values('乒乓球','1','../img/a.jpg','pingpangqiu','2010-5-15') insert into t_p(P_Name,P_Kind,P_Image,P_Content,P_AddDate)values('NBA','2','../img/b.jpg','pingpangqiu','2010-5-15') insert into t_p(P_Name,P_Kind,P_Image,P_Content,P_AddDate)values('男人','4','../img/c.jpg','pingpangqiu','2010-5-15')
select A.commandKey,A.enabled,A.commandFile,A.targetControl,A.rightId,A.type,[B].[value] as commandType,A.state,[C].[value] as commandState,A.parent,A.commandText,A.commandTipText,A.icon ......