MySQL Forums
Forum List  »  New in 4.1: Subqueries

UPDATE syntax
Posted by: Timmy Wong
Date: March 31, 2005 02:31PM

Please provide the correct syntax for the following update statement:

UPDATE tblUsers
SET PenCount = (SELECT COUNT(*) FROM tblPens WHERE tblPens.Owner = tblUsers.UserID)

I hope you can see what the query is trying to achieve.

Options: ReplyQuote


Subject
Views
Written By
Posted
UPDATE syntax
10681
March 31, 2005 02:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.