JMD
2008-11-29 18:54:50 UTC
When I run this query, it shows the data from the three columns of the first table and for some reason that baffles me, the data from the second table is placed underneath the data in the first column of the first table. I am not sure as to what is causing this or what can be done to fix it.
To be more simply put:
Here is the first table:
ITEM PRICE DATE_PURCHASED
Coffee ($1.95) 8/22/2010
Church Contribution ($25.00) 8/22/2010
Groceries ($54.98) 8/22/2010
Bedspread ($215.00) 8/22/2010
Spa ($155.00) 8/22/2010
Dinner W/Gail ($60.00) 8/22/2010
Coffee ($1.95) 8/23/2010
Lunch ($8.50) 8/23/2010
Babysitter ($30.00) 8/23/2010
Coffee ($1.95) 8/24/2010
Lunch ($7.00) 8/24/2010
Drug Store ($34.95) 8/24/2010
Groceries ($102.83) 8/24/2010
Coffee ($1.95) 8/25/2010
Auto Repair ($582.63) 8/25/2010
Sold Painting $2,500.00 8/26/2010
Coffee ($1.95) 8/26/2010
Dinner Party ($187.00) 8/26/2010
Coffee ($1.95) 8/27/2010
Paycheck $4,000.00 8/27/2010
Dinner Dress ($1,300.00) 8/27/2010
Babysitter ($45.00) 8/27/2010
Coffee ($1.95) 8/23/2010
here is the data from the second table:
COST
($53.26)
($148.59)
($350.11)
$1,500.00
($1.95)
($8.50)
($2.43)
($700.00)
($45.00)
($206.14)
($35.00)
($6.25)
$800.00
($1.95)
($1.95)
Here's my query:
select a.item,
a.price,
a.date_purchased
from ex1501_sue a
union all
select b.cost,
null,
null
from ex1501_bob b;
and here's the result:
item price date_purchased
Coffee ($1.95) 8/22/2010
Church Contribution ($25.00) 8/22/2010
Groceries ($54.98) 8/22/2010
Bedspread ($215.00) 8/22/2010
Spa ($155.00) 8/22/2010
Dinner W/Gail ($60.00) 8/22/2010
Coffee ($1.95) 8/23/2010
Lunch ($8.50) 8/23/2010
Babysitter ($30.00) 8/23/2010
Coffee ($1.95) 8/24/2010
Lunch ($7.00) 8/24/2010
Drug Store ($34.95) 8/24/2010
Groceries ($102.83) 8/24/2010
Coffee ($1.95) 8/25/2010
Auto Repair ($582.63) 8/25/2010
Sold Painting $2,500.00 8/26/2010
Coffee ($1.95) 8/26/2010
Dinner Party ($187.00) 8/26/2010
Coffee ($1.95) 8/27/2010
Paycheck $4,000.00 8/27/2010
Dinner Dress ($1,300.00) 8/27/2010
Babysitter ($45.00) 8/27/2010
Coffee ($1.95) 8/23/2010
-53.26
-148.59
-350.11
1500
-1.95
-8.5
-2.43
-700
-45
-206.14
-35
-6.25
800
-1.95
-1.95
the numbers in the item column are from the cost column in the second table. Could somebody out there show me how to fix this problem?