2016-10-17 38 views
0

我有phpmyadmin頁面,我必須改變我的數據庫中的很多行。我有表'lime_answers',並在裏面我有答案語言列。我想要做的就是更新所有的答案,比如說「littlepony」到「bigpony」,但只有當語言列在該行中有「en」時纔可以。所以像MySQL的更新值在列中當有另外兩個特定的文本

SELECT * FROM 'lime_answers' WHERE ('answer' = 'littlepony' AND 'language' = 'en') 
then SET 'answer' = 'bigpony' 

這可能嗎?

回答

1

嘗試使用

update lime_answers set answer = 'bigpony' where answer = 'littlepony' AND language = 'en' 
+0

這一個工作,非常感謝你的基督教,你救了我像4個小時的枯燥的工作:))) ) – zel

2
Try this 


update 'lime_answers' set 'answer' = 'bigpony' 
    where ('answer' = 'littlepony' AND 'language' = 'en') 
1
UPDATE lime_answers SET `answer` = 'bigpony' WHERE (`answer` = 'littlepony' AND `language` = 'en') 

使用此

相關問題