UPDATE PVIDAL/INSPEC A SET A.INMJMN = '6'
WHERE A.INATRB LIKE '%ANODIZE%' AND
      A.INSPEC.INMJMN <> 6      AND
     EXISTS 
      (SELECT 1 
       FROM RGTOPR B
       WHERE A.INITEM = B.RTID  AND 
             B.WKCTR='CA00')
Elvis
  
Celebrating 10-Years of SQL Performance Excellence
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[
mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter Vidal
Sent: Tuesday, April 17, 2007 2:50 PM
To: Midrange Systems Technical Discussion
Subject: Re: SQL UPDATE with SELECT not working
"UPDATE PVIDAL/INSPEC SET INMJMN = '6' WHERE EXISTS..."
I do not want to update all records.  I am doing things wrong, 
definitively. 
I want to update just the ones that follow this selection criteria 
described below.
Files: INSPEC, RTGOPR
Key fields:  INSPEC.INITEM, RTGOPR.RTID
I want to UPDATE NISPEC.INMJMN = '6' only where:
a) INSPEC.INITEM = RTGOPR.RTID
b) INSPEC.INATRB Like '%ANODIZE%'
c) INSPEC.INMJMN<>6
d) RTGOPR.WKCTR='CA00'
Peter Vidal 
PALL Corporation / SR Programmer Analyst, IT Development Group
10540 Ridge Rd., Ste 203, New Port Richey, FL 34654-5111
http://www.pall.com
"The first step to getting the things you want out of life is this: Decide 
what you want."
Ben Stein
As an Amazon Associate we earn from qualifying purchases.