Question

what sql statements should i use to do something like this?

UPDATE 
`table1`
SET
`media` = 'url'
WHERE
`media` = '3' AND `forum_post_id` = ('109918','109949','109882','109819','109822')

right now i am getting the operand should contain 1 column error

Was it helpful?

Solution

Use "IN":

UPDATE `table1`
SET `media` = 'url'
WHERE`media` = '3' AND `forum_post_id` IN ('109918','109949','109882','109819','109822')

Documentation for "IN"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top