如楼上所说,用IF做几个分支就行了。
解决方案 »
- mysql 存储过程 致命问题,求救!~
- 又是 Can't connect to MySQL server on 'localhost' (10061),刷新又正常
- 请问统计每个产品每个月的销售量的SQL应该怎么写?
- 急!急!急! update userinfo set Prestige_Value=sun((select Prestige_Value from userinfo where UserId=1)+1
- PostgreSQL--一个查询问题?
- 谁能给个Mysql图形界面的工具啊!要免费
- mysql 中文乱码问题,已经试过常规方法了,不行,请高手帮忙!
- Mysql入门书籍?
- 怎么控制mysql每天零点自动执行一条插入语句
- ERROR 1410 (42000): You are not allowed to create a user with GRANT
- 关于MYSQL的错误
- mySQL如何实现数据远程集中?
set @sql = 'update user set ';
if(PUserName is not null) then
@sql = concat(@sql, 'username = "test"');
end if;
if(PReMark is not null) then
@sql = concat(@sql, ',Re = 'TestRe'');
end if;
@sql = concat(@sql, ' where userid = 1');
prepare s from @sql;
execute s;
deallocate prepare s;