I think this may be a common problem that may not have an answer for every tool. Right now we are trying to use amazons Redshift. The only problem we have now is we are tryi
Assuming the range is contained within TableA, and the ID is in TableB, the following query should work with SQL
SELECT TableA.*, TableB.* FROM TableA JOIN TableB ON TableA.StartIP <= TableB.ID AND TableB.ID <= TableA.EndIP