Ok, maybe the subject isn't the most descriptive in the world, but my issue is this:
I have a table with several fields, but the only fields we care about are an autonumber primary key and an integer foreign key. I want to get the latest (maximum) primary key for any foreign key. Sample data might be:
So I would want a result set of:
Please tell me this is easy as I've completely gone brain-dead. I look forward to your help...
I have a table with several fields, but the only fields we care about are an autonumber primary key and an integer foreign key. I want to get the latest (maximum) primary key for any foreign key. Sample data might be:
Code:
pk_ID fk_ID
---------------
1 10
2 11
3 12
4 11
5 11
6 13
7 10
So I would want a result set of:
Code:
max_pk_ID fk_ID
------------------
7 10
5 11
3 12
6 13
Please tell me this is easy as I've completely gone brain-dead. I look forward to your help...