修改密码

请输入密码
请输入密码 请输入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

v5.0
搜索
    v5.0

      LET

      概述

      LET语句可通过定义新变量向工作表添加列。使用=运算符为变量赋值。

      <let statement> ::= 
        "LET" <variable definition> [ { "," <variable definition> }... ]
      
      <variable definition> ::= 
        <binding variable> "=" <value expression>
      

      详情

      • LET不改变工作表的记录数。
      • LET不修改工作表中现有的列,除非在LET语句内重新定义已有变量。
      • 无法在同一条LET语句中定义新变量并引用它。

      示例图

      CREATE GRAPH myGraph { 
        NODE Paper ({title string, score uint32, author string}),
        EDGE Cites ()-[{}]->()
      } PARTITION BY HASH(Crc32) SHARDS [1]
      

      INSERT (p1:Paper {_id:"P1", title:'Efficient Graph Search', score:6, author:'Alex'}),
             (p2:Paper {_id:"P2", title:'Optimizing Queries', score:9, author:'Alex'}),
             (p3:Paper {_id:"P3", title:'Path Patterns', score:6, author:'Zack'}),
             (p1)-[:Cites]->(p2),
             (p2)-[:Cites]->(p3)
      

      使用常量定义变量

      LET s = 6, a = "Alex"
      MATCH (p:Paper) WHERE p.score = s AND p.author = a
      RETURN p.title, s, a
      

      结果:

      p.title s a
      Efficient Graph Search 6 Alex

      在LET中引用变量

      如果在LET语句中引用了变量,则LET语句等价于以下的CALL语句:

      "CALL" "(" <referenced variables> ")" "{"
        <let statement>
        "RETURN" <all variables>
      "}"
      

      详情

      • <referenced variables>是逗号分隔的在LET语句中引用的所有变量。
      • <all variables>是逗号分隔的LET语句中包含的所有变量。

      以下查询在LET语句中引用x,并判断其score属性值是否大于7:

      MATCH (x:Paper)
      LET recommended = x.score > 7
      RETURN x.title, recommended
      

      此查询相当于:

      MATCH (x:Paper)
      CALL (x) {
        LET recommended = x.score > 7
        RETURN x, recommended
      }
      RETURN x.title, recommended
      

      结果:

      x.title recommended
      Optimizing Queries 1
      Efficient Graph Search 0
      Path Patterns 0

      以下查询在LET语句中引用p来计算每条路径的长度:

      MATCH p = ()->{1,2}()
      LET length = path_length(p)
      RETURN p, length
      

      结果:

      p length
      1
      1
      2
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写