Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> self join help for an Oracle newbie
Because of poor database design on an application that I inherited, I need
to join two tables that have a one to many relationship while only
outputting a single record. Specifically, I need to join the two tables on
Table A primary key (CustomerID) to Table B's foreign key (CustomerID) while
only keeping the record from Table B that has the lowest date value in a
second field.
I guess I could use VB to Loop through the two
tables but this may take forever...is there a way to do a self join on Table
B that grabs only the record with the lowest date for a singel CustomerID
and then join this resultset
to Table As?
Received on Thu Jun 10 1999 - 18:45:31 CDT