Hi all
I have been reading lots of posts and in most I am getting the picture that looping is "poor practice"... and that you should build a user defined function.
Can someone post a basic example of how you would accomplish simulated looping in a function?
Here is the "english" of what I am trying to accomplish.
I have a table of distinct values.
I want to "loop" through that table and for every record I want to then query another table to find any related records in there. ( a bunch of related segments) Then from there I need to make some comparisons to some date values that are found in the latter table and return a simple date.
I dont' expect anyone to write this for me, I'm just looking for a basic example of how to handle this "looping" for lack of a better term. I can then pick it apart and build what I need.
Thanks!
I have been reading lots of posts and in most I am getting the picture that looping is "poor practice"... and that you should build a user defined function.
Can someone post a basic example of how you would accomplish simulated looping in a function?
Here is the "english" of what I am trying to accomplish.
I have a table of distinct values.
I want to "loop" through that table and for every record I want to then query another table to find any related records in there. ( a bunch of related segments) Then from there I need to make some comparisons to some date values that are found in the latter table and return a simple date.
I dont' expect anyone to write this for me, I'm just looking for a basic example of how to handle this "looping" for lack of a better term. I can then pick it apart and build what I need.
Thanks!