-
To replace selected records in a field based on condition of another field
Hi,
Please can anyone provide an SQL syntax:
To replace selected records in a field based on condition of another field. For example,
Two fields a and b. 'a' field has three records, 1,2,3. b field has x,y and z. I like to replace all records '2' in field a if
field b is x with value 5
Thanks.
Nijojo.
-
Are they in same table? If so, try this:
update table set a = 5 where a = 2 and b = 'x'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|