Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select statement help
Message
 
To
04/03/2004 10:08:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00883085
Message ID:
00883120
Views:
10
Do you mean, as following?
SELE ;
    a.inv_cd, ;
    sum(a.balance+b.balance) balance,;
    sum(a.interest+b.interest) interest,;
    discount,;
    premium;
from table_A a , table_b b;
where a.inv_cd=b.inv_cd;
group by 1
"Group by 1" assuming discount and premium do not change across records for the very same inv_cd, "group by 1,4,5" otherwise.


>I have two tables with almost identical fields.
>
>table A
>
>inv_cd chr(3)
>balance n(10,2)
>interest n(10.2)
>discount n(10,2)
>
>
>table B
>
>inv_cd chr(3)
>balance n(10,2)
>interest n(10.2)
>premium n(10,2)
>
>I need to create a select statement that will produce table C
>
>inv_cd chr(3)
>a.balance+b.balance as balance
>a.interest+b.interest as interest
>discount n(10,2)
>premium N(10,2)
>
>I need to accumilate like inv_cd's into one record.
>
>I hope I explained myself
>
>any help will be appreciated
Previous
Reply
Map
View

Click here to load this message in the networking platform