Hi Patrick!
> I need:
>
> acc.name, acc.phone, acc.acctno, sales1.amt as mo1sales, sales2.amt as
> mo2sales, (sales1.amt - sales2.amt) as diff SORT by diff
>
> I need all data in sales1 and sales2, but only for records from
> acc that are in either/both sales1, sales2.
>
> I tried:
> select f
Patrick Shoaf wrote:
At 09:48 AM 6/4/2003, Bruce Feist wrote:
I suspect that sales1 and sales2 should really be a single 'sales'
table with an extra column indicating which month the sales are for (and
maybe one for year as well), but I don't have enough information to
be sure.
Table sales1 & sa
At 09:48 AM 6/4/2003, you wrote:
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2003-06-04 09:17:01 -0400:
I need all data in sales1 and sales2, but only for records from acc that
are in either/both sales1, sales2.
SELECT acc.name, acc.phone, acc.acctno,
sales1.amt AS mo1sales, sale
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2003-06-04 09:17:01 -0400:
I need all data in sales1 and sales2, but only for records from acc that
are in either/both sales1, sales2.
SELECT acc.name, acc.phone, acc.acctno,
sales1.amt AS mo1sales, sales2.amt AS mo2sales,
# [EMAIL PROTECTED] / 2003-06-04 09:17:01 -0400:
> acc.name, acc.phone, acc.acctno, sales1.amt as mo1sales, sales2.amt as
> mo2sales, (sales1.amt - sales2.amt) as diff SORT by diff
>
> I need all data in sales1 and sales2, but only for records from acc that
> are in either/both sales1, sales2.
>
I am fairly new to MySQL and SQL in general. I have three tables,
acc,sales1,sales2. All have acctno in common. acc is general customer
table with lots of information. sales1 is a generated table of sales for
specific customer from a given month/year. sales2 is the sale as sales1
except for