Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.sqlserver.programming > #31265

Re: Need to fetch data recursively from a table

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups microsoft.public.sqlserver.programming
Subject Re: Need to fetch data recursively from a table
Date 2015-08-05 13:03 +0200
Organization Erland Sommarskog
Message-ID <XnsA4ED84D0A42D5Yazorman@127.0.0.1> (permalink)
References <ee908b1e-167e-466e-9c16-9d1482d15e6e@googlegroups.com> <XnsA4ED6A4C86392Yazorman@127.0.0.1> <be26cc37-5b4d-495a-a274-4b1bd7043293@googlegroups.com>

Show all headers | View raw


 (siddhant171990@gmail.com) writes:
>  - First, Find projects related to original set of features. Each
>  feature can relate to only instance of a project. But, it can relate to
>  many projects. 

So this is illegal?

INSERT tbl(feature, project, instance)
  VALUES ('FTR1', 'A', 1),
         ('FTR1', 'A', 2)

But this is legal?

INSERT tbl(feature, project, instance)
  VALUES ('FTR1', 'A', 1),
         ('FTR1', 'B', 1)


That is, the instance relates to the project alone?

> - Secondly, since some other instance of the projects found above may be
> related to some features, I need to identify those features as well and
> any other projects which these features are also related too. This will
> go on recursively. 
> 
> - Thirdly, every time we fetch features for the projects, we fetch only
> those features that use the instance of the projects greater than the on
> found already. 
> 
> - All in all, there should be some path starting for the initial feature
> list to all records. 

Please supply a wider set of test data with the expected results. This 
helps to clarify your description.



-- 
Erland Sommarskog, Stockholm, esquel@sommarskog.se

Back to microsoft.public.sqlserver.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Need to fetch data recursively from a table siddhant171990@gmail.com - 2015-08-04 23:20 -0700
  Re: Need to fetch data recursively from a table Erland Sommarskog <esquel@sommarskog.se> - 2015-08-05 10:26 +0200
    Re: Need to fetch data recursively from a table siddhant171990@gmail.com - 2015-08-05 01:57 -0700
      Re: Need to fetch data recursively from a table Erland Sommarskog <esquel@sommarskog.se> - 2015-08-05 13:03 +0200
        Re: Need to fetch data recursively from a table siddhant agarwal <siddhant171990@gmail.com> - 2015-08-05 04:06 -0700
    Re: Need to fetch data recursively from a table siddhant171990@gmail.com - 2015-08-05 02:38 -0700

csiph-web