polynominalc
Programmer
Hi
I have written the following sql query below.
SELECT TOP 100 PERCENT dbo.RQREQUIREMENTS.REQUIREMENTPREFIX, dbo.RQREQUIREMENTS.REQUIREMENTNAME,
dbo.RQREQUIREMENTS.REQUIREMENTTEXT, dbo.RQREQUIREMENTS.VERSIONNUMBER,
RQREQUIREMENTS_1.REQUIREMENTPREFIX AS [Traced From], dbo.RQREQUIREMENTHISTORY.VERSIONNUMBER AS [Version History],
dbo.RQREQUIREMENTHISTORY.VERSIONDATETIME, dbo.RQREQUIREMENTHISTORY.VERSIONREASON
FROM dbo.RQREQUIREMENTS RQREQUIREMENTS_1 INNER JOIN
dbo.RQTORELATIONSHIPS ON RQREQUIREMENTS_1.ID = dbo.RQTORELATIONSHIPS.REQUIREMENTID RIGHT OUTER JOIN
dbo.RQREQUIREMENTS ON dbo.RQTORELATIONSHIPS.TOID = dbo.RQREQUIREMENTS.ID FULL OUTER JOIN
dbo.RQREQUIREMENTHISTORY ON dbo.RQREQUIREMENTS.ID = dbo.RQREQUIREMENTHISTORY.ID
WHERE (dbo.RQREQUIREMENTS.REQUIREMENTTYPEID = 51) AND (dbo.RQREQUIREMENTS.REQUIREMENTPREFIX = 'req1501')
The problem is that I keep bringing back three lots of the same change history for the record when I have joined the dbo.RQREQUIREMENTHISTORY table to the query i.e
Version History
1
1
1
2
2
2
Can anybody see what is wrong
Thanks
Mark
I have written the following sql query below.
SELECT TOP 100 PERCENT dbo.RQREQUIREMENTS.REQUIREMENTPREFIX, dbo.RQREQUIREMENTS.REQUIREMENTNAME,
dbo.RQREQUIREMENTS.REQUIREMENTTEXT, dbo.RQREQUIREMENTS.VERSIONNUMBER,
RQREQUIREMENTS_1.REQUIREMENTPREFIX AS [Traced From], dbo.RQREQUIREMENTHISTORY.VERSIONNUMBER AS [Version History],
dbo.RQREQUIREMENTHISTORY.VERSIONDATETIME, dbo.RQREQUIREMENTHISTORY.VERSIONREASON
FROM dbo.RQREQUIREMENTS RQREQUIREMENTS_1 INNER JOIN
dbo.RQTORELATIONSHIPS ON RQREQUIREMENTS_1.ID = dbo.RQTORELATIONSHIPS.REQUIREMENTID RIGHT OUTER JOIN
dbo.RQREQUIREMENTS ON dbo.RQTORELATIONSHIPS.TOID = dbo.RQREQUIREMENTS.ID FULL OUTER JOIN
dbo.RQREQUIREMENTHISTORY ON dbo.RQREQUIREMENTS.ID = dbo.RQREQUIREMENTHISTORY.ID
WHERE (dbo.RQREQUIREMENTS.REQUIREMENTTYPEID = 51) AND (dbo.RQREQUIREMENTS.REQUIREMENTPREFIX = 'req1501')
The problem is that I keep bringing back three lots of the same change history for the record when I have joined the dbo.RQREQUIREMENTHISTORY table to the query i.e
Version History
1
1
1
2
2
2
Can anybody see what is wrong
Thanks
Mark