I have two tables (Application, Applicant). Every application can have 1 or 2 applicants. Primary key in Application (oid) is the foreign key in Applicant(app_oid). Applicants have different lastnames and SSNs. I would like to allow searching for applications based on lastname or ssn of either applicant. I would also like to do it in one sql statement. Note i need both applicants to comeback in the result set even if only one of theirs (ssn, lastname) matches the requested value.
posted 14 years ago
Join to the Applicant table twice. Once to select both applicants, and again to filter the applications by applicant name.
If it is possible that both applicants could be the same, you might need
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads