|
|
| Author |
Message |
johnrembo Cacti User
Joined: 24 Apr 2006 Posts: 198
|
Posted: Thu Dec 20, 2007 9:43 am Post subject: out there and back ( lcoal_data_id <-> local_graph_id) |
|
|
Hi,
could anyone please give me sql select which could return local_graph_id by local_data_id:
short form looks like:
| Quote: | select xxx.local_graph_id
from yyy
where local_data_id=5 |
cacti sources are full of reverse solutions, when local_data_id is extracted by knowing local_graph_id, but this isn't what I need.
thank you |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9697 Location: MI, USA
|
Posted: Thu Dec 20, 2007 11:23 pm Post subject: |
|
|
It's a pain in the you know what. I did not write it, so I will not take the blame We hope to "FIX" it one day.
Either way, try this:
| Code: | SELECT DISTINCT
graph_local.id, data_local.id
FROM graph_local
INNER JOIN ((data_template_rrd
INNER JOIN graph_templates_item
ON data_template_rrd.id=graph_templates_item.task_item_id)
INNER JOIN data_local
ON data_template_rrd.local_data_id=data_local.id)
ON graph_local.id = graph_templates_item.local_graph_id; |
TheWitness |
|
| Back to top |
|
 |
johnrembo Cacti User
Joined: 24 Apr 2006 Posts: 198
|
Posted: Fri Dec 21, 2007 4:42 am Post subject: |
|
|
| TheWitness wrote: | It's a pain in the you know what. I did not write it, so I will not take the blame We hope to "FIX" it one day.
Either way, try this:
| Code: | SELECT DISTINCT
graph_local.id, data_local.id
FROM graph_local
INNER JOIN ((data_template_rrd
INNER JOIN graph_templates_item
ON data_template_rrd.id=graph_templates_item.task_item_id)
INNER JOIN data_local
ON data_template_rrd.local_data_id=data_local.id)
ON graph_local.id = graph_templates_item.local_graph_id; |
TheWitness |
merry cristmas and gracias!
waiting for a new cactus plant in santas sock... |
|
| Back to top |
|
 |
|