Before, sorry for my english...
Ok. Let's go...
1st: We have two Data Inputs for source like
Code: Select all
a:1 b:1 c:1
Code: Select all
a:1 b:1 d:1 e:1 f:1
Code: Select all
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| id | data_input_id | name | data_name | input_output | update_rra | sequence | type_code |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| 418 | 26 | F | f | out | on | 0 | |
| 416 | 26 | E | e | out | on | 0 | |
| 417 | 26 | D | d | out | on | 0 | |
| 419 | 26 | B | b | out | on | 0 | |
| 415 | 26 | A | a | out | on | 0 | |
| 105 | 26 | Hostname (FQDN) | hostname | in | | 2 | hostname |
| 106 | 26 | Source Filename | filename | in | | 1 | |
| 109 | 68 | C | c | out | on | 0 | |
| 110 | 68 | B | b | out | on | 0 | |
| 111 | 68 | A | a | out | on | 0 | |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
10 rows in set (0.00 sec)
Code: Select all
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| id | data_input_id | name | data_name | input_output | update_rra | sequence | type_code |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| 418 | 26 | F | f | out | on | 0 | |
| 416 | 26 | E | e | out | on | 0 | |
| 417 | 26 | D | d | out | on | 0 | |
| 509 | 26 | C | c | out | on | 0 | |
| 419 | 26 | B | b | out | on | 0 | |
| 415 | 26 | A | a | out | on | 0 | |
| 105 | 26 | Hostname (FQDN) | hostname | in | | 2 | hostname |
| 106 | 26 | Source Filename | filename | in | | 1 | |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
8 rows in set (0.00 sec)
Code: Select all
SELECT * FROM `data_template_rrd` a WHERE a.`data_input_field_id` NOT IN (SELECT b.`id` FROM `data_input_fields` b);