I have 3 tbs, I do the following get the id of tb1 in common with tb2 and tb3 (id), then compare if field 1 of tb1 (LENGTH) is greater than field 1 of t2, in tbs 1 and 2 there are several ids of tb3, (it is necessary to go through tbs 2 and 3 all doing this comparison) as are many records takes a lot, so I would like a select bringing just a few ids to do little ..