Hi,
I have 2 tables, that do not have a relating key.... but lets say they both have a 'lastname' field.
I want to join the 2 tables and sort by 'lastname'.
What's the SQL that will do that?
Thaanks!
Try this:
SELECT t1.* FROM table1name t1 INNER JOIN table2name t2 ON t1.lastname = t2.lastname ORDER by t1.lastname
That will list all the details of the people who are in both tables in alphabetical order (according to their lastname)
HTH
GM
Thanks Trooper,
Another question... lets say I want to add a third table into the mix... call it t3
now t1 and t2 both have an ID that references t3
How do I add t3 into your SQL mix?