需要MySQL语法 [英] MySQL syntax wanted

查看:86
本文介绍了需要MySQL语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




基本上我想为给定的id增加一个计数器变量在MySQL表中(使用UPDATE)

Hi,

basicly I want to increase a counter variable for a given "id" in a MySQL table (using UPDATE)

展开 | 选择 | Wrap | 行号

推荐答案

在som询问和咨询谷歌后似乎我需要一个TRIGGER和一个存储过程的组合?


我想,我只需要声明(创建)触发/存储过程一次,但我不确定(我虽然这些例子暗示着,但是,有人可以澄清这一点吗?


进一步研究它


Dormi
after som asking and consulting google it seems like I need a combination of TRIGGER and a stored procedure?

I suppose, I only need to declare (create) the trigger/stored procedure once, but I''m not sure (I couldn''t find a clear statement for that, though the examples imply that), could someone clarify that?

looking further into it

Dormi


我'触发器出现问题
I''m having trouble with the trigger
展开 | 选择 | Wrap | 行号


请参阅插入的mysql refmanual并检查INSERT ... ON DUPLICATE KEY更新将有所帮助。
See the mysql refmanual for Insert and check if INSERT ... ON DUPLICATE KEY UPDATE will help.


这篇关于需要MySQL语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆