Help on query
Posted by: Augustin Poelmans
Date: December 30, 2018 06:16PM

Hi,

I need your help !
I have two tables from Plesk :

Table 1 = IP_Addresses
+----+---------------+-----------------+-------+--------------------+-------------------+-------+--------+---------------+-------------------+-------+
| id | ip_address | mask | iface | ssl_certificate_id | default_domain_id | ftps | status | serviceNodeId | public_ip_address | main |
+----+---------------+-----------------+-------+--------------------+-------------------+-------+--------+---------------+-------------------+-------+
| 1 | 51.68.227.XX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | NULL | true |
| 4 | 54.38.125.XX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | | false |
| 5 | 54.38.125.XX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | | false |
| 6 | 51.75.102.XXX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | | false |
| 7 | 79.137.8.XXX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | | false |
| 8 | 193.70.70.XXX | 255.255.255.255 | eth0 | 1 | 0 | false | 0 | 1 | | false |
+----+---------------+-----------------+-------+--------------------+-------------------+-------+--------+---------------+-------------------+-------+

Table 2 = ip_pool
+----+---------------+--------+
| id | ip_address_id | type |
+----+---------------+--------+
| 1 | 1 | shared |
| 1 | 4 | shared |
| 1 | 5 | shared |
| 1 | 6 | shared |
| 1 | 7 | shared |
| 1 | 8 | shared |
| 2 | 1 | shared |
| 4 | 5 | shared |
+----+---------------+--------+

"ip_address_id" in Table 2 is equal to "id" in Table 1.

What I want is a query that give me as output, the IP addresses from Table 1 where (in Table 2) ip_address_id appear only one time. (So, Ip addresses that is only in one pool, the pool 1)

Something like :

+---------------+
| ip_address |
+---------------+
| 54.38.125.XX |
| 51.75.102.XXX |
| 79.137.8.XXX |
| 193.70.70.XXX |
+---------------+

Can someone help me ?

Tx,

Augustin Poelmans
Student in Belgium

Options: ReplyQuote


Subject
Written By
Posted
Help on query
December 30, 2018 06:16PM
December 30, 2018 08:49PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.