Joining 2 tables

shortieg

New Member
Joined
Nov 4, 2011
Messages
3
This might be a newbie question, I have the following 2 tables, each table contains 2 fields:

table1---------------table2

field1 field2----------field3 field4
1a --- 1b------------- 1c-- 1d
2a ----2b------------- 2c-- 2d

the 2 tables have no relationships and no indices. (no primary keys)
what I want to do is to join the 2 tables using sql.

so i have

SELECT table1.field1,table1.field2,table2.field1,table2.field2,
FROM table1,table2


however this query returns all possible combinations.

The data on both tables are in correct sequence. so I want the resulting table to be like:

field1 field2 field3 field4
1a --- 1b--- 1c-- 1d
2a ----2b--- 2c-- 2d

I am running out of ideas. Hope someone can help me with this.

Also, is there a way to add a column to this new table to number (or primary key autonumber) each row.


thanks.
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,488
Messages
6,125,092
Members
449,206
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top