Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join multiple tables

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
0
0
I keep being told that I have too many tables. How can I join them? Most of them have fields named the same. Could I join say 24 tables together and add a field that shows the name of the table each record originally came from?

I didn't understand it at first but now I see how this would be more efficient.

Each table has a different name so i'd like a field with the name of each table as i need to be able to differentiate between my records in this way.
 
Normally it requires adding a field.
Assume you have tables of customers, suppliers, employees.

Each of these tables has first name, last name, MI, telephone, email.

this can be one table, "tblPersons". You can then add a field personType with values of Customer, Supplier, Employee. If you want to see/work with just the employees you query the table "where personType = 'Employee'".

If these tables have a lot of fields in common, but also a lot not in common then you may not want a single table.
 
FYI, the term is not "Join", that means something else in database lingo. You want to "merge" records into a single table. Also this can be automated through SQL through either an "append" query or "make table" query. You will not have to copy/paste or do any of this manually
 
Hey,

The time difference is a real pain between here and America! I successfully merged the tables. Took a while but i've it done!

Thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top