• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 38
  • Last Modified:

update table query

select ord.id,orditm.order_id,orditm.prior_code
 from dss.orders ord, ordered_items orditm 
  where ord.id = orditm.order_id
   and ord.customer_po in
('8835 SOS','8693 SOS','8614 SOS','8610 SOS','8706 SOS','8757 SOS','8703 SOS','8785 SOS','8653 SOS','8770 SOS',
 '8690 SOS','8807 SOS','8614 SOS','8689 SOS','8687 SOS','8642 SOS','8631 SOS','8126 SOS','8543 SOS','8403 SOS',
 '8519 SOS','8535 SOS','8430 SOS','8548 SOS','8423 SOS','8383 SOS','8397 SOS','8448 SOS','8398 SOS','8080 SOS',
 '8155 SOS','8158 SOS')

Open in new window


I have 32 rows. Need to made the prior_code as null from ordered_items table. Basically remove the data that is in the column prior_code.

tried update ordered_items
  set prior_code = null
where order_id in (select....

gives me error. Need help
0
anumoses
Asked:
anumoses
1 Solution
 
slightwv (䄆 Netminder) Commented:
what was the error?  IS the select above what you used in the update?

If so, there is the problem.

See if this works:
update ordered_items
  set prior_code = null
where order_id in (
select id
 from dss.orders ord
where ord.customer_po in
('8835 SOS','8693 SOS','8614 SOS','8610 SOS','8706 SOS','8757 SOS','8703 SOS','8785 SOS','8653 SOS','8770 SOS',
 '8690 SOS','8807 SOS','8614 SOS','8689 SOS','8687 SOS','8642 SOS','8631 SOS','8126 SOS','8543 SOS','8403 SOS',
 '8519 SOS','8535 SOS','8430 SOS','8548 SOS','8423 SOS','8383 SOS','8397 SOS','8448 SOS','8398 SOS','8080 SOS',
 '8155 SOS','8158 SOS')
)

Open in new window

0
 
anumosesAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now