This Question is Answered

2 "helpful" answers available (2 pts)
3 Replies Last post: Feb 4, 2010 7:39 AM by Amudha  
Amudha   2 posts since
Feb 4, 2010
Currently Being Moderated

Feb 4, 2010 5:56 AM

Netezza Update

Hi All,

 

I want a equivalent neteeza update statement for the below mentioned Oracle update

 

UPDATE SHIPMENT   s1

SET ORIGIN_SIC_ID =

(SELECT sic.sic_id sic_id

  FROM sic_location sic

WHERE s1.orig_trmnl_sic_cd = sic.sic_code

and s1.ORIGIN_SIC_ID IS NULL

  )

WHERE EXISTS

(SELECT sic.sic_id sic_id

  FROM sic_location sic

WHERE s1.orig_trmnl_sic_cd = sic.sic_code

and s1.ORIGIN_SIC_ID IS NULL

  )

 

or basically some update staement which uses inline / subquery.

 

Thanks,Amudha

Shawn Fox   384 posts since
Aug 15, 2006
Currently Being Moderated
1. Feb 4, 2010 6:46 AM in response to: Amudha
Re: Netezza Update

This is actually much easier to do in Netezza since Netezza allows a FROM clause in your UPDATE statement:

 

update shipment s1
set origin_sic_id = sic.sic_id
from sic_location sic
where s1.ORIGIN_SIC_ID is null
  and s1.orig_trmnl_sic_cd = sic.sic_code

Superuser   82 posts since
Sep 19, 2008
Currently Being Moderated
2. Feb 4, 2010 6:49 AM in response to: Amudha
Re: Netezza Update

.

More Like This

  • Retrieving data ...