我想显示在我的数据库结果萨姆值的语句,我用这个代码,但我不能成功:倍数。如果在MySQL
SELECT item_code, IF(category_code = 'HERR1', 'NO', 1) OR (category_code = 'COLN5', 'NO', 2) AS category_code, item_name, item_quantity FROM qa_items
编辑: 我想显示例如:
If category_code = 'HERR1'
Display = 1
else if category_code = 'COLN5'
Display = 2
End If
如果任何人有任何想法,将不胜感激
好吧,select语句不会导致底层数据发生任何变化。您需要改为使用UPDATE语句。 – 2012-03-10 17:20:51
对不起,我的意思是显示结果 – 2012-03-10 17:22:40
你收到了什么错误?你能发布预期的和实际的产出吗? – 2012-03-10 17:25:22