'Need to run a MySQL join on 2 Zabbix tables to output IP and NAME based on HOSTID [duplicate]

I'm having trouble creating the output from two Zabbix tables. I would like to output IP(interafce) and NAME(hosts) using HOSTID.

interface table

| hostid |       ip     |
|   1    |    1.1.1.1   |
|   2    |    8.8.8.8   |

hosts table

| hostid |        name   
|   1    |    test.server.1  |
|   2    |    test.server.2  |

So i would like something like this

| hostid |      ip       |      name
|   1    |    1.1.1.1    |  test.server.1  |
|   2    |    8.8.8.8    |  test.server.2  |

Thanks for you help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source