>> We have two tables, and are trying to populate a third table by selecting the first available processing number for each ID. The two tables are joined like this: <<
Where is the DDL for these two nameless tables (no, putting a number after the word "table" is not a name. It's a design flaw called a tibble) Why do you believe that there is such a thing as a universal, generic, Kabbalah "id" in RDBMS (an identifier has to be the identifier of something in particular). We don't even know the data types, much less the keys in these two tables! We have no idea how the join was done.
Why do you think that this shows good netiquette? Does your boss make you work from things like this? Or do you just always shovel most important parts of the design off on somebody else?
Why are you populating another table? SQL can use a VIEW, but your mindset is still stuck in the days of punch cards and magnetic tape, when you had to physically materialize a result set.
>> Any help would be appreciated <<
We feel the same way 🙁
CREATE TABLE Foobars
(foobar_id CHAR(4) NOT NULL,
process_nbr INTEGER NOT NULL,
PRIMARY KEY (foobar_id, process_nbr);
CREATE VIEW First_Foobars (foobar_id, process_nbr_min)
SELECT foobar_id, MIN(process_nbr)
GROUP BY foobar_id;
Please post DDL and follow ANSI/ISO standards when asking for help.