-1

I have two tables, pricelist.plpart and bsp_priceupdate.xplpart

all prices in pricelist table need to be updated with 3% EXCLUDING those in the bsp_priceupdate table.

i will be running this update in sql 7.

Appreciate your help.

D

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
gomo
  • 1
  • 1
  • Hi, The query will run on SQL 7 server. – gomo Mar 30 '15 at 19:59
  • Something like UPDATE TBL1 set FLD1=3 WHERE EXISTS (Select 1 from TBL2...etc. ...) – Darius X. Mar 30 '15 at 20:06
  • I was thinking of something like: update pricelist set plunitprice = plunitprice + (plunitprice *.03) where pricelist.plpart <> bsp_priceupdate.xplpart – gomo Mar 30 '15 at 20:09

1 Answers1

0

I think something like this ought to do it...

UPDATE pricelist.plpart
SET price = ROUND( price * 1.03, 2 )
WHERE NOT EXISTS (
    SELECT *
    FROM bsp_priceupdate.xplpart
    WHERE bsp_priceupdate.xplpart.partID = pricelist.plpart.partID )
DeadZone
  • 1,633
  • 1
  • 17
  • 32