I have db schema which needs to allow multiple parts to be linked to the same tool record. Example being LH / RH parts, or different colors of the parts, which use the same tool.
So, three tables involved:
[parts] <----> [partstoolslink] <----> [tools]
There is a key on the [partstoolslink] table preventing multiple records for the same part / tool linkage.
For a tool report, I need only unique tool listings, and the part number column may show any of the parts that tool record is linked to.
I keep getting duplicate tools records in the report due the fact that said tool is linked to multiple parts, and the partnumber field is included on the report.
If I, for example, GROUP BY the tool table, SQL Server complains that the partnumber field is not included in the GROUP BY. So, it wants to list duplicate tool records which are linked to different parts... which is NOT what I need.
Suggestions?
So, three tables involved:
[parts] <----> [partstoolslink] <----> [tools]
There is a key on the [partstoolslink] table preventing multiple records for the same part / tool linkage.
For a tool report, I need only unique tool listings, and the part number column may show any of the parts that tool record is linked to.
I keep getting duplicate tools records in the report due the fact that said tool is linked to multiple parts, and the partnumber field is included on the report.
If I, for example, GROUP BY the tool table, SQL Server complains that the partnumber field is not included in the GROUP BY. So, it wants to list duplicate tool records which are linked to different parts... which is NOT what I need.
Suggestions?