468,510 Members | 1,797 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

update query with select query

hello there;

im trying to use the following piece of code but it doest work,

UPDATE itermdesc SET qnty = ( SELECT qnty -1
FROM itermdesc
WHERE itermcode =1001 )
WHERE itermcode =1001

it display the following error

You can't specify target table 'itermdesc' for update in FROM clause

Any quick help would be much appreciated!
Jan 15 '12 #1
1 1451
144 100+
try something like: UPDATE itermdesc SET qnty = (qnty -1)
WHERE itermcode =1001.

get rid of the statement inside the statement.
Jan 15 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by parwal.sandeep | last post: by
5 posts views Thread by Roger | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.