函数

  • 普通函数
    • select ABS(-10) —10 绝对值
    • select CEILING(5.5) —6 向上取整
    • select FLOOR(5.5) —5 向下取整
    • select RAND() — 返回一个0-1之间的随机数

concat(xx,xx) 拼接字符

  • select CHAR_LENGTH(‘你好啊’) —3 返回字符串长度

    … …

  • 聚合函数

    • select COUNT(studentName) from xxx 查个数,会忽略null
      select COUNT(*) from xxx 不会忽略null,本质是查行数
      select COUNT(1) from xxx 不会忽略null,本质是查行数

    • select SUM(studentScore) from xxx 查总和

    • select AVG(studentScore) from xxx 查平均数
    • select MAX/MIN(studentScore) from xxx 查最高/最低

MD5加密
不可逆!相同值加密后是一样的
函数 - 图1
函数 - 图2