Notion的database其实提供了一种Property,能够让一个数据库中获取到另一个数据库的数据

下方演示

示例

我先建立一个Database1,里面存放name ,EventDate

Database1

再建立一个数据库2,我需要让事件1,2,3分别与001,002,003绑定,获取到Database1的Date,Event数据,并展示在Database2中

方法如下

  1. Database2中新建一个RelationProperty,并选取Database1

    https://pic-1259640338.cos.ap-shanghai.myqcloud.com/img/Screen Shot 2022-04-01 at 12.39.12.png

    https://pic-1259640338.cos.ap-shanghai.myqcloud.com/img/Screen Shot 2022-04-01 at 12.32.06.png

  2. Database2中新建一个RollupProperty,设定Relation为第一步设置的Property,选择要关联的Property为Date/Event/name

    https://pic-1259640338.cos.ap-shanghai.myqcloud.com/img/Screen Shot 2022-04-01 at 12.41.25.png

  3. 将事件1的RelationToDatabase1选定为001

    https://pic-1259640338.cos.ap-shanghai.myqcloud.com/img/Screen Shot 2022-04-01 at 12.43.17.png

  4. 可以看到Rollup_Database1_Date已经自动显示了

    https://pic-1259640338.cos.ap-shanghai.myqcloud.com/img/Screen Shot 2022-04-01 at 12.44.07.png

Untitled

以此类推,即可完成对Database1中Event,name的查询

绑定Relation后,Database的Rollup行为就是SQL中的

SELECT Date from Database1
WHERE Name = '001';