修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      CASE

      概述

      函数CASE根据条件将一个或多个值表示为指定的值,可设置多组条件。函数CASE需配合关键词WHENTHENELSEEND一起使用。

      函数CASE支持以下两种语法:

      case
        when <condition> then <output>
        when <condition> then <output>
        ...
        else <otherOutput>
      end
      
      • <condition>:条件的表达式
      • <output>:满足条件时的输出结果
      • <otherOutput>:所有条件均不满足时的输出结果

      case <expression>
        when <value> then <output>
        when <value> then <output>
        ...
        else <otherOutput>
      end
      
      • <expression>:表示相等条件的表达式中,==符号前面的部分
      • <value>:表示相等条件的表达式中,==符号后面的部分
      • <otherOutput>:所有条件条件均不满足时的输出结果

      ELSE语句可以省略,省略时如果不满足所有列出的条件,则输出<output>数据类型的默认值。

      条件判断(WHEN)自上而下按顺序执行,遇到满足的条件就执行相应的输出(THEN),余下的条件判断不再执行。

      一般用法

      本例计算2023年每月拟发薪日(15号)是星期几:

      uncollect ["2023-1-15","2023-2-15","2023-3-15","2023-4-15","2023-5-15","2023-6-15","2023-7-15","2023-8-15","2023-9-15","2023-10-15","2023-11-15","2023-12-15"] as payday
      return CASE dayOfWeek(payday)
      when 1 then "Sunday"
      when 2 then "Monday"
      when 3 then "Tuesday"
      when 4 then "Wednesday"
      when 5 then "Thursday"
      when 6 then "Friday"
      when 7 then "Saturday"
      END
      

      Sunday
      Wednesday
      Wednesday
      Saturday
      Monday
      Thursday
      Saturday
      Tuesday
      Friday
      Sunday
      Wednesday
      Friday
      

      本例计算2023年每月的实际发薪日,规则是如果拟发薪日(15号)为周末,则顺延至下个星期一:

      uncollect ["2023-1-15","2023-2-15","2023-3-15","2023-4-15","2023-5-15","2023-6-15","2023-7-15","2023-8-15","2023-9-15","2023-10-15","2023-11-15","2023-12-15"] as payday
      return CASE dayOfWeek(payday)
      when 1 then dateAdd(payday, 1, "day")
      when 7 then dateAdd(payday, 2, "day")
      else dateAdd(payday, 0, "day")
      END
      

      WHEN条件中,函数dateAdd()对星期日或星期六的拟发薪日payday进行偏移,并输出偏移后的时间;ELSE对应payday为工作日的情况,但也需使用dateAdd()函数将输出转换为时间类型,与WHEN的输出保持一致。

      2023-01-16 00:00:00
      2023-02-15 00:00:00
      2023-03-15 00:00:00
      2023-04-17 00:00:00
      2023-05-15 00:00:00
      2023-06-15 00:00:00
      2023-07-17 00:00:00
      2023-08-15 00:00:00
      2023-09-15 00:00:00
      2023-10-16 00:00:00
      2023-11-15 00:00:00
      2023-12-15 00:00:00
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写