简体   繁体   English

光学查询中减去 function

[英]Minus function in Optic Query

I have requirement to do minus in one of the use case but in MarkLogic I am not able to use minus function.我需要在其中一个用例中做减号,但在 MarkLogic 中我无法使用减号 function。 Is there any alternate way to do this?有没有其他方法可以做到这一点?

select table1.value1 from table1 where table1.date = '2020-11-27'
minus
select table1.value1 from table1 where table1.date = '2020-11-26'

The " MINUS " operator is a SPARQL operator. MINUS ”运算符是一个 SPARQL 运算符。 Similar functionality is supported in MarkLogic's Optic API using the op:except() operator. MarkLogic 的 Optic API 使用op:except()运算符支持类似的功能。 You can also use the " MINUS " operator in SPARQL and op:from-sparql() in the Optic API, and the " EXCEPT " operator in SQL and op:from-sql() in the Optic API.您还可以使用 SPARQL 中的“ MINUS ”运算符和 Optic API 中的op:from-sparql() ,以及 SQL 中的“ EXCEPT ”运算符和 Optic ZDB9742CE387084 中的op:from-sql()

The minus/subtraction operator in XQuery is "-", like in most languages. XQuery 中的减/减运算符是“-”,就像在大多数语言中一样。 The rest of your code looks a bit like SQL to me (though I last used SQL about 30 years ago) and it will all need changing.你的代码的 rest 在我看来有点像 SQL (尽管我上次使用 SQL 大约是 30 年前),它都需要改变。

I don't now what "Optic Query" is, I'm afraid.恐怕我现在不知道“光学查询”是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 声明变量中的列在光学查询 MarkLogic 中不起作用 - Declare column in variable is not working in Optic query MarkLogic 使用光学查询从当前日期减去 6 个月的日期 - Subtract 6 months date from the current date using Optic Query MarkLogic 中的光学查询错误 - 无效强制:map:map - Error in Optic query in MarkLogic - Invalid coercion: map:map 使用两个索引的 MarkLogic 光学查询不返回任何结果 - MarkLogic optic query using two indexes returns no results 为什么我的 Optic API 查询的结果不是我在排序和过滤时所期望的? - Why are the results of my Optic API query not what I'm expecting when sorting and filtering? MarkLogic 光学查询中的错误 - 获取模板视图文档中记录出现的百分比 - Error in MarkLogic Optic Query - to get percentage of occurrence of a record in a template view document 如何使用光学 API 加入具有相似值的视图? - How do you join views with similar values with the Optic API? Marklogic - 光学 API:按值连接视图(op:on 不支持值,仅支持列引用) - Marklogic - Optic API: Joining views by value (op:on does not support values, only column-references) MarkLogic Optic API:使用 op:where() 过滤时间戳超过 30 天的行 - MarkLogic Optic API: Filtering rows with op:where() with timestamps older than 30 days 在具有名称空间的函数中查询XML数据 - Query XML data in a function with namespace
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM