views:

57

answers:

1

in an ms access database with two tables

TableA
MSN     PR1
12      A
13      B
11      C
14      X

TableB
MSN     PR2
14      L
12      M
13      O
11      X

how can i write an sql query so that PR2 columns gets added to TableA but only after matching the MSN values . so the final TableC would be

TableC
MSN     PR1   PR2
12      A      M
13      B      O
11      C      X
14      X      L

any help appreciated

A: 

You can create a named query with the SQL: SELECT * FROM TableA JOIN TableB USING (MSN), or if you prefer SELECT * FROM TableA, TableB WHERE TableA.MSN = TableB.MSN

Romain