April 22, 201411 yr Ok, I have a solution where there has been no serial incremented ID of fields tracked, as the solution is using UUID for most parent child relationships. I have a calculation where I need to return the first and last values of child relationship as seen from the parent relationship, but I have to do it from the child table. To get the first record of a child set of records is easy, as the creation order of the records dictates the first record, however without some type of serially incremented ID, there is no way to reverse that order (at least as far as I know). I can't use timestamp as the records are created all at once in a loop very quickly, so most of the time they'll have the same timestamp. What I want to do is create a self join relationship that joins on the foreign key of the parent table and then sorts the self join the values returned from Get ( RecordID ). The only way that I can think of to do this is to create a field that is automatically calc'd via the Get ( RecordID ) function, and because it's being used in a relationship, it has to be indexed going forward. Is this a viable solution to my problem? I can't think of any other way to sort records in reverse creation order. I thought I've heard that this may be a bad idea, but other than a corrupt database I can't think of a situation where this field would not return a unique value for each record. I guess I could use a serial incremented field, however then I'd have to worry about making sure that the value of the field is set if I ever import/export the records into a duplicate table. Am I completely missing an easy solution to this problem?
Create an account or sign in to comment