当另外两个

时间:2016-10-17 13:48:24

标签: mysql

我有phpmyadmin页面,我必须更改数据库中的许多行。我有表'lime_answers',里面有回答语言列。我想要做的是更新所有答案,让我们说“littlepony”到“bigpony”,但只有当语言列在该行中有“en”时才会更新。像

这样的东西
SELECT * FROM 'lime_answers' WHERE ('answer' = 'littlepony' AND 'language' = 'en') 
then SET 'answer' = 'bigpony'

这可能吗?

3 个答案:

答案 0 :(得分:2)

let str = "Say Hello to My Little Friend"
let data = str.data(using: String.Encoding.utf16)
print("\(data!)")

答案 1 :(得分:1)

尝试使用

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

答案 2 :(得分:1)

UPDATE lime_answers SET `answer` = 'bigpony' WHERE (`answer` = 'littlepony' AND `language` = 'en')

使用此