---
title: "mysql SET and UPDATE"  
description: "mysql SET and UPDATE"  
author: "Anonymous User"  
published: 2013-07-09  
updated: 2013-07-09  
canonical: https://www.mindstick.com/forum/1276/mysql-set-and-update  
category: "mysql"  
tags: ["mysql"]  
reading_time: 1 minute  

---

# mysql SET and UPDATE

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to [replace](https://yourviews.mindstick.com/view/81330/cow-antibody-research-in-usa-a-step-ahead-to-replace-plasma-therapy) a [column value](https://www.mindstick.com/forum/161178/how-to-delete-duplicate-rows-based-on-single-column-value-in-mssql) based off [values](https://www.mindstick.com/forum/327/sum-textbox-values) from other columns, but I keep getting syntax errors. What am I [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp)? Here's what I've tired:\
**[SELECT](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) * FROM `table` WHERE `id_1` =164 and `id_2` = 6****SET `id_1` = (188|164)****WHERE `id_1` = 164 AND `id_2` = 6** **[UPDATE](https://www.mindstick.com/forum/156353/what-is-hummingbird-update) `table`**\
This gives me a syntax near SET.\
**SELECT * FROM `table` WHERE `id_1` = 164 AND `id_2` = 6****UPDATE `table`****SET `id_1` = 188****WHERE `id_2` = 6**\
This gives me an [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) for everything below UPDATE.\
Help? Thanks.

## Replies

### Reply by Cast Broady

![mysql SET and UPDATE](https://www.mindstick.com/mindstickforums/f7dea4f1-2966-42a9-b09b-15a888be51a2/images/1de5fbf3-54f5-486d-932b-829fac3144bf.jpeg)

if you want fill Picture field you can use update

UPDATE PictureProduct

SET Picture =

(SELECT * FROM OPENROWSET(BULK N'C:\1.jpg', SINGLE_BLOB) AS image)

WHERE Id = 6

### Reply by AVADHESH PATEL

Hi,\
\
You cann't use the UPDATE and SELECT both within a one query.\
Execute the both query separately like this:\
**SELECT * FROM `table` WHERE `id_1` = 164 AND `id_2` = 6**And then execute:\
**UPDATE `table`****SET `id_1` = 188****WHERE `id_2` = 6**;\


---

Original Source: https://www.mindstick.com/forum/1276/mysql-set-and-update

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
