Hello to all. I need some help on SQL as Im new to it. I have the following two tables:
AMOUNTS (a)
Account_ID
Period_name
Amount
ACCOUNTS (b)
Acount_ID
By using the following SQL query:
I get
Account_ID SUM(Amount) Period_name
XXXXX XXXXX AAAAA
XXXXX XXXXX BBBBBB
How can I get?
Account_ID AAAAA BBBBB
XXXXXX XXXXX XXXXX
Thanks in advance for any kind help.
Octavio
AMOUNTS (a)
Account_ID
Period_name
Amount
ACCOUNTS (b)
Acount_ID
By using the following SQL query:
Code:
SELECT b.Account_ID , SUM(a.Amount), a.Period_name
FROM AMOUNTS a, ACCOUNTS b
WHERE a.Account_ID = b.Account_ID
GROUP by b.Account_ID,a.Period_name
Account_ID SUM(Amount) Period_name
XXXXX XXXXX AAAAA
XXXXX XXXXX BBBBBB
How can I get?
Account_ID AAAAA BBBBB
XXXXXX XXXXX XXXXX
Thanks in advance for any kind help.
Octavio