0

I have 2 tables viz. Table_A and Table_B with one column in each table and the values are shown below

Table_A:

IP_info
10.30.111.222

Table_B:

IP_info
11.55.67.777,10.30.111.222,10.23.567.233

Can you help me out in joining these values in MS SQL or any other SQL (using single query)?

The goal is to display 1 row with these 2 values, since the value of Table_A.IP_info "10.30.111.222" exist in Table_B.IP_info (approximately matching)

Luuk
  • 12,245
  • 5
  • 22
  • 33
  • What's the expected result? – The Impaler Oct 02 '22 at 01:33
  • 1
    Don't use comma-separated lists, normalize table B. But if you're stuck with this, use `FIND_IN_SET()`. – Barmar Oct 02 '22 at 01:35
  • you need to show more examples and/or explain better what you are trying to do. if table_A also had a 10.23.567.233 row, do you then want two rows in the results? what if a table_A value is in multiple table_B rows or in no table_B rows, what do you want then? – ysth Oct 02 '22 at 05:27
  • The expected result should show one row with these two values in 2 columns (basically these 2 values should join). – Raghavendra Maiya Aug 01 '23 at 11:50

0 Answers0