List all schedules for all nodes

jca001

Active Newcomer
Joined
Jun 30, 2008
Messages
7
Reaction score
0
Points
0
Location
Georgia
We have been creating some new schedules and moving nodes from existing schedules to the new schedules. Because there is no move node from scheduleA to scheduleB, you have to do an add and deleted. So now I need to make sure we don't have a node on multiple schedules.

I know I can get a list of all the nodes associated with each schedule via "q association" and then look at all the schedules for a duplicate nodes. But there are about 15 schedules and over 300 nodes. And I can see if a given node is associated with multiple schedules via

select node_name,schedule_name from associations where node_name='ABC'

But this means I would have to run the command over 300 times.

What I want is to get a list of all the schedules for all the nodes.

I have tried something like:

select node_name,schedule_name from associations where node_name is (select node_name from node)

But I cannot seem to get the correct syntax. I want the output to be something like:

node_name schedule_name
----------- --------------
ABC SCHED1
DEF SCHED1
DEF SCHED2
GHI SCHED1
 
I must be missing something because the following select would easily show all nodes associated with a schedule and order them by the node_name then by schedule_name.

select node_name, schedule_name from associations order by node_name, schedule_name
 
Chad:
No, you are not missing anything, I am. The little I know about SQL is using something sombody else wrote and making minor changes.

Thanks for the quick reply, that is exactly what I was looking for.

I ran it and from the first page I found 2 nodes on multiple schedules and they were not even some we have been working with. They have probably been there for a while.
 
Back
Top