Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

compare id list for match - show percentage -how to?

$
0
0

I'm just trying to get some opinions on the best way to attempt the following

Tbl one has three cols:

AutoID, ParentMaterialId, MaterialID

This tbl contains several records for each Parent MaterialID, linking a load of other MaterialIDs to that parent:

Example

1, 1, 800
2, 1, 801
3, 1, 968

This is used to create a simple listing so when choosing a parent materialID in the application you can then see a list of the 'linked' materialID's.  So far - so straight forward.

I'm now looking to build something where you can throw a speculative list of MaterialsID together in the application, then to rifle through the existing listings table (above) and see if there are any matches for that specific set of linked MaterialID's.

I can think of a couple of ways of doing this, but wanted to make sure I've got the most efficient method I can.

Above that, and to add another level to it, I would then be looking to expand that method so that lets say there was a list of three speculative materialIDs thrown at this query, as well as finding any exact matches, it would also show me any results with only two of the three for example.

However lets get the first one sorted out first!

I would really love to hear anyone's suggestions..


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>