Hi Lads,
Quick question here. I'm not lazy enough to be looking for a neatly packaged solution or anything

, just a few pointers in the right direction.
My problem is I have two tables, where the second one has a description to be associated with a name on the first table.
The 'name' exists in a full form on the first table e.g. John Smith but the 'name' on the second may be the full name or an initial string ending in a % wildcard.
There is also the issue of the entries on the second table being public or private.
I want to associate (join) the description on the second table with the entries on the first table with the following type of hierarchy:
# Public wildcard e.g. John%
which can be overridden by
# Public fully qualified e.g. John Smith
which can be overridden by
# Private wildcard e.g. John%
which can be overridden by
# Private fully qualified e.g. John Smith
Is there any way to do this with some advanced well constructed SQL statement, or am I looking at multiple SQL statements and then business logic in my server side code (Java)?
Any help appreciated.