I am attempting to join two tables by comparing and matching values in separate columns. Please bear with me:
Table 1
==========
Name
IP address
Table 2
==========
IP address
Rating
I need to write a query that groups all the IP addresses that correspond to a certain group in the Name column from Table 1and match them with a rating from Table 2.
Can someone point me in the direction of the type of queries I should be looking at?
Without completely spelling it out for all the reasons that @KenWhite mentioned in his comment…
When you relate data from two different tables (in your case trying to find common IP addresses), you’ll usually want to use some form of a
JOIN. There are many different kinds of these. Here is a good reference, but there are many other good references if you spend some time searching for them.The decision of which kind of
JOINto use will come down to whether or not you want to display IP Addresses which have no corresponding rating.Moving on – you mentioned that you want to only show ratings for IP addresses that correspond to a certain Name group. For that, you’ll need to use a
WHEREclause in your query. This is pretty straight forward – for reference, you can visit MSDN.I think with these references and a bit of research / effort on your part, writing the query you describe shouldn’t be an issue.