开发者

SQL update function, know which cell I want, how to find row

开发者 https://www.devze.com 2023-04-08 22:17 出处:网络
I want to update a row like this: _id, AttributeA, AttributeB, AttributeC I need to find a row based on AttributeC so tha开发者_开发问答t I can update it, lets say the desired AttributeC contains v

I want to update a row like this:

_id, AttributeA, AttributeB, AttributeC

I need to find a row based on AttributeC so tha开发者_开发问答t I can update it, lets say the desired AttributeC contains value "X"

How would this be done?

I believe this would be done with a WHERE argument but can I get this whole statement spelled out?


Something like

UPDATE table
SET AttributeB='value'
WHERE AttributeA = 'X'

This will update all rows where AttributeA = 'X' and set AttributeB to 'value', if there are more than 1.


Start by looking at the UPDATE syntax. If you get stuck, show us what you've tried and we can help further


update TableA 
set AttributeC = 'XXX' 
where AttributeC like "%X%"
0

精彩评论

暂无评论...
验证码 换一张
取 消