Subquery nested in Update query

J

JoeA2006

I am trying to update a columns with a column from a subquery and I receive
"an operation must use updateable query"

UPDATE MyTable SET MyField = (Select TheField from TheTable where TheField >1)

How should I do this?
 
J

John W. Vinson

I am trying to update a columns with a column from a subquery and I receive
"an operation must use updateable query"

UPDATE MyTable SET MyField = (Select TheField from TheTable where TheField >1)

How should I do this?

The subquery could contain many different values of MyField. If MyTable
contains 2125 records and TheTable contains 5124 records, all with different
values of TheField, which of those 5124 values should be put into each record
of MyTable?!

Please explain the real world situation. What are your tables? How are they
related? Which record or records do you want to update, and how do you
ascertain which record should supply the value?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top