Closed frostime closed 12 months ago
一个更简单的示例:
SELECT * from blocks where created like "20231115" || "%"
似乎是字符串连接出错了
一个更简单的示例:
SELECT memo from blocks where memo like "2023111" || "5"
这必然会查到无意义的结果,而无需你真的在 memo 填写 20231115
等一下老哥,这个意思是更新之后 union 反而不能用了吗 😂
哦,好像理解有误。意思是根据是否有 '||' 选择不同的解析器是吧。。
能用的,只是不带 LIMIT 的话性能会比原来差(原来是预加 LIMIT,现在是查询后结果集中 LIMIT)。
似乎 limit 语句不能单独换行,否则对查询结果有影响。 @88250
给我一下 SQL 我测试看看,谢谢。
---Original---
From: @.>
Date: Fri, Nov 17, 2023 18:52 PM
To: @.>;
Cc: @.**@.>;
Subject: Re: [siyuan-note/siyuan] Kernel API /api/query/sql
support ||
operator (Issue #9662)
似乎 limit 语句不能单独换行,否则对查询结果有影响。 @88250
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
SELECT (select count(1) from refs as r where r.def_block_id = b.id ) as 被引数, (select count(1) from refs as r where r.root_id = b.id ) as 正引数 FROM blocks as b WHERE type = 'd' limit 228;
------------------ 原始邮件 ------------------
发件人: "siyuan-note/siyuan" @.>;
发送时间: 2023年11月17日(星期五) 晚上6:59
@.>;
@.**@.>;
主题: Re: [siyuan-note/siyuan] Kernel API /api/query/sql
support ||
operator (Issue #9662)
给我一下 SQL 我测试看看,谢谢。
---Original---
From: @.>
Date: Fri, Nov 17, 2023 18:52 PM
To: @.>;
Cc: @.**@.>;
Subject: Re: [siyuan-note/siyuan] Kernel API /api/query/sql
support ||
operator (Issue #9662)
似乎 limit 语句不能单独换行,否则对查询结果有影响。 @88250
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>
这个语句两个解析器都无法正常解析,所以走了内置原生的执行,但是我看了下,执行结果应该是对的:
Kernal API SQL 未能查询到预期的结果
Is there an existing issue for this?
Can the issue be reproduced with the default theme (daylight/midnight)?
Could the issue be due to extensions?
Describe the problem
给定下述 SQL 查询
在 Navicat 中连接思源 db,直接结果是正常的:搜索今天所有创建的文档
但是在思源中基于后端 API 查询的时候,就无法查询成功
Query 挂件也是查不到任何东西
Expected result
和 Navicat 中的查询保持一致。
Screenshot or screen recording presentation
No response
Version environment
Log file
日志中没有什么有用的信息。
More information
No response