2014-04-28 264 views
1

我想更新表sheethproject集列值「是」,其中customerhproject =「是」UPDATE語句的WHERE子句

UPDATE `sheet` SET `hproject` = 'yes' WHERE (
SELECT `customer` 
FROM `sheet` 
WHERE `hproject` = 'yes' 
) 

上面的查詢不工作,我會感激任何幫助或指導。

問候

回答

2

嘗試:

UPDATE `sheet` SET `hproject` = 'yes' WHERE `customer` in (
    select * from(
    SELECT `customer` 
    FROM `sheet` 
    WHERE `hproject` = 'yes' 
)t 
)