1 SQL from more than on table without foreign key
Posted: Fri Oct 08, 2004 2:53 am
I have 3 tables - table1, table2, table3 - all have a field called Name
table1 has 20 Names
table1 has 30 Names
table1 has 50 Names
I want all the names from all the tables in one query (100 names) :
SELECT * FROM table1,table2,table3 will return 30000 names (repeats)
and SELECT DISTINCT(t1.Name),DISTINCT(t2.Name),DISTINCT(t3.Name) FROM table1 t1, table2 t2, table3 t3 doesnt work.
What other options are there ?
Thanks
table1 has 20 Names
table1 has 30 Names
table1 has 50 Names
I want all the names from all the tables in one query (100 names) :
SELECT * FROM table1,table2,table3 will return 30000 names (repeats)
and SELECT DISTINCT(t1.Name),DISTINCT(t2.Name),DISTINCT(t3.Name) FROM table1 t1, table2 t2, table3 t3 doesnt work.
What other options are there ?
Thanks