danIT Posted February 11, 2009 Posted February 11, 2009 Is it possible to use UPDATE and set the WHERE to only UPDATE where the value = ANYNUMBER? For Example: UPDATE user_accounts set password_reset = 1 where user_ID = NumericValue?
webman Posted February 11, 2009 Posted February 11, 2009 If it's a User_ID, and the column type is INT, then all rows in the table should be numeric? If some rows are null for this field, then you can use: UPDATE user_accounts SET password_reset = 1 WHERE user_id IS NOT NULL;
danIT Posted February 11, 2009 Author Posted February 11, 2009 Your correct, just couldn't see further than the end of my nose for a moment or to!
Arcath Posted February 11, 2009 Posted February 11, 2009 you can also leave the WHERE bit off to have it update all records unconditionally
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now