7.2 Interval-based search
SQL
SELECT *
FROM Orders
WHERE OrderDate>='2021-12-29' and OrderDate<='2021-12-31'
SPL
For numeric and date type fields, interval-based searches are often needed. And sorting index is the only suitable one for those fields involving interval-based search.
A | |
---|---|
1 | >st=date(“2021-12-29”), et=date(“2021-12-31”), start=days@o(st), end=days@o(et) |
2 | =file(“Orders.ctx”).open() |
3 | =A2.index(file(“Orders.ctx__OrderDate”);OrderDate) |
4 | =A2.icursor(;OrderDate>=start && OrderDate<=end).fetch() |
5 | =A2.close() |
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProcSPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL