View Full Version : Select Query Question


ecupirate
04-25-2002, 04:57 PM
I have a query pulling from two tables. Both tables have a salary field, not good design, but built this way for a reason. Question in my query how do I make the salary field in table 2 = the salary in table 1. When I run my select query. Really don't want to use an Update query..

Thanks

RV
04-25-2002, 10:11 PM
What you're trying to do is to select the salary in table2 which is related to the salary in table1, right?

If so, you'll have to combine the two tables in a query using an inner join.
There has to be a unique key in each table which uniquelly identifies a row in each table.

Assuming you unique key is SalaryID, try this:

SELECT table1.Salary
FROM table1 INNER JOIN table2 ON table1.SalaryID = table2.SalaryID
;
RV