in reply to Sort label
Then there's a slight confusion about the statement of the problem: you say:
i only want the F labels if they don't exist in the G labels so in this case i would want my output to be F01213.Does that actually mean that you don't want the output to show the G labels at all (meaning that the G labels are only being selected so that you know which F labels to discard)?
Something like gryphon's idea, using a hash, is probably the first thing I would try. But maybe I'd query for the "G" records first, to populate the hash using just the numeric part of those IDs, then query for the "F" records, and print the ones whose ID numbers do not exist in the hash. (If you want to print the G labels in combination with the distinct F labels, that's still easy enough -- just add the distinct F entries to the hash as you go, and print the whole hash afterwards.)
|
---|