Need help writing another SQL query
Posted on 2008-10-27
Thanks for helping me writing sql queries.
I need your help in writing another one. I am sure it is simple, but i am not able to figure it out.
Table has proj_id, cust_id, prod_id.
proj_id + cust_id + prod_id is table primary key.
A customer and project may have multiple products
in prod_id column I have ids like 24, 30, 3003, 50 , 200, 2090 etc etc.....
I need to work on 24 and 30....
for each record in table where prod_id is in 24,30, if
only ID 24 exists change it to 3980
only ID 30 exists change it to 3980
both 24 and 30 exists change 24 to 3980 and 30 to 00030 (want to delete it in the end, but not right now)
all data and changes are in same table.
Thanks for your help