Q
Problem solve Get help with specific problems with your technologies, process and projects.

Multiplying fields from different tables

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?
This was last published in October 2002

Dig Deeper on IBM DB2 management

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchAWS

SearchContentManagement

SearchOracle

SearchSAP

SearchSQLServer

Close