ich komme gerade bei einer Abfrage in MySQL nicht weiter. Ich habe:
Code: Alles auswählen
mysql> SELECT DISTINCT t1.string AS IP_Adr, t2.mac_address
-> FROM ip_addresses t1, devices t2, activity t3
-> WHERE t3.device_id = t2.id
-> AND t3.ip_address_id = t1.id
-> AND t2.ip_static_id IS NOT NULL
-> ORDER BY t1.string
-> LIMIT 0 , 50;
+------------+-------------------+
| IP_Adr | mac_address |
+------------+-------------------+
| 10.1.0.254 | 00:xx:21:04:yy:1d |
| 10.1.1.11 | 00:xx:81:79:yy:AD |
| 10.1.1.14 | 00:xx:d3:e6:yy:a2 |
| 10.1.1.171 | 00:xx:8f:d7:yy:81 |
| 10.1.1.172 | 00:xx:d3:e6:yy:e0 |
| 10.1.1.19 | 00:xx:48:91:yy:80 |
| 10.1.1.2 | 00:xx:21:00:yy:DE |
| 10.1.1.2 | 00:xx:21:00:yy:be |
| 10.1.1.2 | 00:xx:D3:E6:yy:F6 |
| 10.1.1.210 | 00:xx:3e:6c:yy:b3 |
| 10.1.1.214 | 00:xx:3e:44:yy:a3 |
| 10.1.1.215 | 00:xx:3e:30:yy:12 |
| 10.1.1.216 | 00:xx:3e:7a:yy:7a |
| 10.1.1.254 | 00:xx:21:00:yy:DE |
| 10.1.1.27 | 00:xx:48:d0:yy:ef |
| 10.1.1.4 | 00:xx:d3:e6:yy:e0 |
| 10.1.1.5 | 00:xx:21:00:yy:DE |
| 10.1.1.5 | 00:xx:48:88:yy:82 |
| 10.1.2.170 | 00:xx:21:00:yy:DE |
| 10.1.2.254 | 00:xx:21:00:yy:be |
+------------+-------------------+
20 rows in set (0.00 sec)
Code: Alles auswählen
+------------+-------------------+
| string | mac_address |
+------------+-------------------+
| 10.1.1.2 | 00:xx:21:00:yy:DE |
| 10.1.1.2 | 00:xx:21:00:yy:be |
| 10.1.1.2 | 00:xx:D3:E6:yy:F6 |
| 10.1.1.5 | 00:xx:21:00:yy:DE |
| 10.1.1.5 | 00:xx:48:88:yy:82 |
+------------+-------------------+