N
N Lee
Greetings,
I have two tables of about 10 columns each, which share 5 common
columns.
Is there a way to join the tables together, and join then on those 5
common columns?
I have one table of 12 columns, and one table of 8 columns. 5 of those
columns are the same. I would want a query that would give me an
output with 15 columns.
Here's a small example, to be viewed in a monospaced font:
Table 1
+------------+------------+------------+------------+------------+
| City | State | Street | License # | Car Type |
+------------+------------+------------+------------+------------+
| Cincinnati | Ohio | Vine St. | RT555000 | Volvo |
| Syracuse | New York | Main St. | VM8004220 | Ford |
| San Jose | California | Alameda | 8209031 | Jeep |
+------------+------------+------------+------------+------------+
Table 2
+------------+------------+------------+------------+
| License # | Car Type | Infraction | Fine |
+------------+------------+------------+------------+
| VM8004220 | Ford | Speeding | $50 |
| 8209031 | Jeep | Expired Lic| $100 |
| QQ5002 | Lincoln | No signal | $25 |
+------------+------------+------------+------------+
Desired Query Output
+------------+------------+------------+------------+------------
+------------+------------+
| City | State | Street | License # | Car Type |
Infraction | Fine |
+------------+------------+------------+------------+------------
+------------+------------+
| Cincinnati | Ohio | Vine St. | RT555000 | Volvo |
(null) | (null) |
| Syracuse | New York | Main St. | VM8004220 | Ford |
Speeding | $50 |
| San Jose | California | Alameda | 8209031 | Jeep |
Expired Lic| $100 |
| (null) | (null) | (null) | QQ5002 | Lincoln | No
signal | $25 |
+------------+------------+------------+------------+------------
+------------+------------+
The join is done on "License #" and "Car Type".
Thanks for any help.
I have two tables of about 10 columns each, which share 5 common
columns.
Is there a way to join the tables together, and join then on those 5
common columns?
I have one table of 12 columns, and one table of 8 columns. 5 of those
columns are the same. I would want a query that would give me an
output with 15 columns.
Here's a small example, to be viewed in a monospaced font:
Table 1
+------------+------------+------------+------------+------------+
| City | State | Street | License # | Car Type |
+------------+------------+------------+------------+------------+
| Cincinnati | Ohio | Vine St. | RT555000 | Volvo |
| Syracuse | New York | Main St. | VM8004220 | Ford |
| San Jose | California | Alameda | 8209031 | Jeep |
+------------+------------+------------+------------+------------+
Table 2
+------------+------------+------------+------------+
| License # | Car Type | Infraction | Fine |
+------------+------------+------------+------------+
| VM8004220 | Ford | Speeding | $50 |
| 8209031 | Jeep | Expired Lic| $100 |
| QQ5002 | Lincoln | No signal | $25 |
+------------+------------+------------+------------+
Desired Query Output
+------------+------------+------------+------------+------------
+------------+------------+
| City | State | Street | License # | Car Type |
Infraction | Fine |
+------------+------------+------------+------------+------------
+------------+------------+
| Cincinnati | Ohio | Vine St. | RT555000 | Volvo |
(null) | (null) |
| Syracuse | New York | Main St. | VM8004220 | Ford |
Speeding | $50 |
| San Jose | California | Alameda | 8209031 | Jeep |
Expired Lic| $100 |
| (null) | (null) | (null) | QQ5002 | Lincoln | No
signal | $25 |
+------------+------------+------------+------------+------------
+------------+------------+
The join is done on "License #" and "Car Type".
Thanks for any help.