By
Published: 04 Oct 2002
I am trying to multiply two single fields from two different tables and put that answer into a new field in a table. I am trying to estimate the individual Project Costs by taking the Techs rate in the Users table and multiplying it by the Techs individual hourly rate. Each tech has a different hourly rate. The cost will then be displayed for that particular Project Name. Every Project Name has one technician and it is not allowed to have multiple names of Projects. I've been looking online for a week now, and in books, and there seems to be no answer. Help!
Well, let's see if I have it right and can help out. The way I read your questions the two tables would look something...
like this:
USER
-----
Tech
TechRate
PROJECT
--------
ProjName
Tech
TechIndividualHourlyRate
How about this?
SELECT P.ProjName, U.TechRate * P.TechIndividualHourlyRate
FROM USER U,
PROJECT P
You want to multiply TechRate by TechIndividualHourlyRate when PROJECT.Tech equals USER.Tech, correct? Or did I miss something?
Dig Deeper on IBM DB2 management
To export data from a DB2 table to a flat file, you need to run an export specifying the proper file format. The export utility exports data from a ...
Continue Reading
Craig Mullins recommends two specific resources for learning how to create and support Binary Large Objects (BLOB) in DB2.
Continue Reading
Craig Mullins explains various definitions of a data mart and sheds some light on the complexity of its relation to a data warehouse.
Continue Reading