dbTalk Databases Forums  

Help with Update Query using Sub-query

comp.databases.postgresql comp.databases.postgresql


Discuss Help with Update Query using Sub-query in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mehoss
 
Posts: n/a

Default Help with Update Query using Sub-query - 01-07-2009 , 02:30 PM






I get an error when I run this one, Im new to postgresql and think
that this syntax used to work on ms sql...could be wrong, been a
while.
any suggested corrections?? thanks in advance

UPDATE ifservices
SET ifservices.notify = 'F'
WHERE id IN (
SELECT
F.id
FROM
ifservices as F,
node,
service,
categories,
category_node
WHERE
F.serviceid = service.serviceid AND
node.nodeid = F.nodeid AND
categories.categoryid = category_node.categoryid AND
category_node.nodeid = node.nodeid AND
categories.categoryname = 'Switches' AND
(service.servicename = 'SSH' OR
service.servicename = 'HTTP')

);




ERROR IS:

: ERROR: column "ifservices" of relation "ifservices" does not exist



Reply With Quote
  #2  
Old   
mehoss
 
Posts: n/a

Default Re: Help with Update Query using Sub-query - 01-07-2009 , 02:47 PM






I found the error, correction is below second SET notify = 'F'
instead of set ifservices.notify = 'F'

On Jan 7, 3:30*pm, mehoss <myfriendhe... (AT) yahoo (DOT) com> wrote:
Quote:
I get an error when I run this one, Im new to postgresql and think
that this syntax used to work on ms sql...could be wrong, been a
while.
any suggested corrections?? *thanks in advance

UPDATE ifservices
SET notify = 'F'
WHERE id IN * (
SELECT
* * *F.id
FROM
* * *ifservices as F,
* * *node,
* * *service,
* * *categories,
* * *category_node
WHERE
* * *F.serviceid = service.serviceid AND
* * *node.nodeid = F.nodeid AND
* * *categories.categoryid = category_node.categoryid AND
* * *category_node.nodeid = node.nodeid AND
* * *categories.categoryname = 'Switches' AND
* * *(service.servicename = 'SSH' OR
* * *service.servicename = 'HTTP')

);

ERROR IS:

: ERROR: *column "ifservices" of relation "ifservices" does not exist


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.