日期:2014-05-16  浏览次数:20502 次

递归查询某id下的所有子节点
	StringBuffer sql = new StringBuffer();
			
			sql.append("  with copytable  as                                          																												");
			sql.append("   (																																										");
			sql.append("   select c.CATEGORIZATIONPLANGUID  from DT_ERMS_CATEGORIZATIONSCHEMES_CATEGORIZATIONINFO_METADATA  c where c.PID ='"+ nodeguid + "'    and  c.STATE!='2'                                           ");
			sql.append("  union all                              																														            ");
			sql.append("  select c.CATEGORIZATIONPLANGUID from copytable z                                          																					");
			sql.append("  inner join DT_ERMS_CATEGORIZATIONSCHEMES_CATEGORIZATIONINFO_METADATA c                                          																");
			sql.append("  on z.CATEGORIZATIONPLANGUID=c.PID   and c.STATE!='2'                                        															   								");
			sql.append("   )                                          															   							                                     	");
			sql.append("   select copytable.CATEGORIZATIONPLANGUID from copytable                                          															   				");
			
			logger.debug(sql);

?