zoukankan      html  css  js  c++  java
  • SQLServer基本函数

    1.字符串函数 :
    字符操作类 :
    upper(char_expr) 转为大写
    lower(char_expr) 转为小写
    UCase(string) 返回 Variant (String),其中包含转成大写的字符串。
    LCase(string) 返回字符串的小写形式。
    space(int_expr) 生成int_expr个空格
    replicate(char_expr,int_expr) 复制字符串int_expr次
    reverse(char_expr) 反转字符串
    stuff(char_expr1,start,length,char_expr2) 将字符串char_expr1中的从 start开始的length个字符用char_expr2代替
    ltrim(char_expr) rtrim(char_expr) 去掉空格
    ascii(char) char(ascii) 两函数对应,取ascii码,根据ascii吗取字符
    字符串查找 :
    charindex(char_expr,expression) 返回char_expr的起始位置
    patindex("%pattern%",expression) 返回指定模式的起始位置,否则为0
    locate(substr,str,pos) 返回子串substr在字符串str第一个出现的位置
    2.数学函数
    abs(numeric_expr) 求绝对值
    ceiling(numeric_expr) 取大于等于指定值的最小整数
    exp(float_expr) 取指数
    floor(numeric_expr) 小于等于指定值得最大整数
    power(numeric_expr,power) 返回power次方
    rand([int_expr]) 随机数产生器
    round(numeric_expr,int_expr) 安int_expr规定的精度四舍五入
    sign(int_expr) 根据正数,0,负数,,返回+1,0,-1
    sqrt(float_expr) 平方根
    exp(float x):求e的x次幂
    tan(float x):计算x(弧度表示)的正切值。
    atan(float x):求x(弧度表示)的反正切值
    cos(float x):求x(弧度表示)的余弦值
    acos(float x):求x(弧度表示)的反余弦值
    sin(float x):计算x(弧度表示)的正弦值。
    asin(float x):求x(弧度表示)的反正弦值
    fabs(float x):求浮点数x的绝对值
    fmod(float x, float y):计算x/y的余数
    pow(float x, float y):计算x的y次幂。
    sqrt(float x):计算x的平方根。
    3.日期,时间函数
    getdate() 返回日期
    datename(datepart,date_expr) 返回名称
    datepart(datepart,date_expr) 取日期一部份
    datediff(datepart,date_expr1.dateexpr2) 日期差
    dateadd(datepart,number,date_expr) 返回日期加上 number
    4.系统函数
    suser_name() 用户登录名
    user_name() 用户在数据库中的名字
    user 用户在数据库中的名字
    show_role() 对当前用户起作用的规则
    db_name() 数据库名
    object_name(obj_id) 数据库对象名
    col_name(obj_id,col_id) 列名

    Andorid手机开发
  • 相关阅读:
    netcore保持活动状态超时设置
    使用 .net core 自定义项目模板
    Prometheus(普罗米修斯)——适合k8s和docker的监控系统
    移动端调试神器vConsole--腾讯的
    .netcore项目部署到linux的docker里后,速度异常的慢
    GIT删除本地tag和远程tag
    .netcore里使用StackExchange.Redis TimeOut 情况解决方法
    asp.netcore Log4Net连接kafka的方法
    asp.netcore 高并发下使用HttpClient的方法
    [离散时间信号处理学习笔记] 7. z变换
  • 原文地址:https://www.cnblogs.com/yewei798/p/1805439.html
Copyright © 2011-2022 走看看