title: Mysql get unique data from two tables of unequal fields
body: <p>I have two tables that store IP numbers. The number of columns of each table is different. I need to get the unique IP's that are in both tables. Given table structures of</p>
  <pre><code>    table A {
      ip_number int(64)   UNSIGNED,
      str varchar(20)
      status tinyint(1),
      name varchar(10).
      address varchar9100)
      }   
      table B {
      ip_number int(64)   UNSIGNED,
      cnt int,
      last datetime
      }   
  </code></pre>
  <p>with entries like</p>
  <pre><code>    table A {
       123456789,
       'aaa',
       1,
       'bob',
       '123' 
      }
      table B {
       234567890,
       1,
       2022-02-20,
       
       345678901
       2,
       2021-03-03
       }
  </code></pre>
  <p>I want a result like (numbers made up)</p>
  <pre><code>    123.34.45
      123.34.46
      123.34.47
  </code></pre>
  <p>I've tried a number of variations found here but none worked. This one runs without failures but doesn't return any results:</p>
  <pre><code>    SELECT INET_NTOA(ip_number) as ip_number, a.str, a.status FROM table A as a
      join
      (SELECT INET_NTOA(ip_number) as ip_number FROM table B ) as b
      order by ip_number
  </code></pre>
  <p>I also tried using union but, apparently, that only works if the column numbers are the same. Would someone explain how to do this, please?</p>