How Update column based at other column value

I have a table with 4 column : postID - postREF - postValue - postimageID

I want to do update at postVAlUE but under a condition that postimageID = 50;

so now I use :

update Mytable SET postValue = "test2" WHERE postID = 20; 

but I need to check if postimageID = 50 then do this update . since I have many rows with same postID


You can combine where clauses, for example:

update Mytable
SET postValue = 'test2'
  postID = 20 and
  postimageID = 50 ;

Category: mysql Time: 2016-07-29 Views: 4

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.141 (s). 12 q(s)