Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello, have a tables related question 1

Status
Not open for further replies.

ShyFox

Programmer
Mar 22, 2003
210
ES
Hy, I'm new here so I salute you.
I would like to know how can I make a table from two tables.
They have three common fields: ID, Employes and Salary. How can I make another table with the same fields the only change is that this table is created every three months and the field Salary contains the sum of those three months. So if John has a 30 000 $ a month after three months he'll apppear in this table with 90 000$. The tables are not related and I can change them only for the moment when I extract the data. So I can't make a tag or use them in exclusive mode.
 
I think this would do what you want...

select distict ID, Employes , sum(Salary) as salary ;
group by 1 into table Quarterly
 
Wouldn't it be a bit more like this?

sele f.id,f.employes,sum(s.salary);
from firsttblname as f,secondtblname as s;
group by s.id;
into dbf quarterly
 
furmious (TechnicalUser)
Thank you !!!!
Thank you all!
Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top