jamesm6162
01-17-2008, 07:34 AM
Hi
I'm Using SQL Server 2005 and have the following query for creating a view:
SELECT c.somefield, p.otherfield, ...and some other fields
FROM TABLE1 AS c INNER JOIN
TABLE2 AS p
ON c.personnel_number = p.personnel_number AND c.period = p.period
Both period and personnel_number appear in both tables and are non unique in the table. But for each period there only exists one of each personnel_number.
After running the query the view ends up with more records than either one of the tables. (180000 compared to 170000)
What can be the cause of this? And what exactly does the AND operator work in that context?
I'm Using SQL Server 2005 and have the following query for creating a view:
SELECT c.somefield, p.otherfield, ...and some other fields
FROM TABLE1 AS c INNER JOIN
TABLE2 AS p
ON c.personnel_number = p.personnel_number AND c.period = p.period
Both period and personnel_number appear in both tables and are non unique in the table. But for each period there only exists one of each personnel_number.
After running the query the view ends up with more records than either one of the tables. (180000 compared to 170000)
What can be the cause of this? And what exactly does the AND operator work in that context?