美文网首页
mysql 函数

mysql 函数

作者: Mervyn_2014 | 来源:发表于2019-06-27 22:27 被阅读0次

replace() :用来替换数据库中数据

#把 news 表中id大于1000的数据,其中url列中的包含https的数据改为http。

UPDATE news SET url=replace(url, 'https', 'http') where id > 1000; 

group by ... HAVING ... : 查找分数大于60分的用户

#查找分数大于60分的用户
SELECT uid,AVG(score) s FROM record GROUP BY score HAVING s > 60

相关文章

网友评论

      本文标题:mysql 函数

      本文链接:https://www.haomeiwen.com/subject/ydsvbxtx.html