need some help with an opennms query/insert

Поиск
Список
Период
Сортировка
От Patrick Ramsey
Тема need some help with an opennms query/insert
Дата
Msg-id 472B2E08.17DE.0070.0@wellstar.org
обсуждение исходный текст
Ответы Re: need some help with an opennms query/insert  (Alan Hodgson <ahodgson@simkin.ca>)
Список pgsql-novice
Hey guys,
 
I am an OpenNMS admin and new to Postgres.  I have just updated around 1100 devices manually with multiple categories and left out a category from each...  What I would like to do is run a sql statement that will select any node with a category ID of X and add to that node a category ID of Y....
 
pgsql 8.1.5
 
table looks like this:
 
public.category_node (trimmed to one nodeid)
 
categoryid nodeid
27            865
26            865
I want to search all rows for categoryid of 27, then insert a row with categoryid of 30 to that same nodeid.  so it would look like this.
 
categoryid nodeid
27            865
26            865
30            865
 
I think I have this much:
 
SELECT "categoryid" FROM "public"."category_node" WHERE "categoryid" = '27'
 
Is this the right track?  and then, how do I insert a row?
 
thanks!
 
-P
 
 

____________________________________________________________ 
This email and any files transmitted with it may contain confidential and /or proprietary information in the possession of WellStar Health System, Inc. ("WellStar") and is intended only for the individual or entity to whom addressed. This email may contain information that is held to be privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any unauthorized access, dissemination, distribution or copying of any information from this email is strictly prohibited, and may subject you to criminal and/or civil liability. If you have received this email in error, please notify the sender by reply email and then delete this email and its attachments from your computer. - Thank you.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jon Sime
Дата:
Сообщение: Re: What data type best used for money
Следующее
От: Alan Hodgson
Дата:
Сообщение: Re: need some help with an opennms query/insert