---
title: "Discussion on \"Query the Records Closest to the Specified Time Each Day — From SQL to SPL #43\" | Hashnode"
description: "Discussion on \"Query the Records Closest to the Specified Time Each Day — From SQL to SPL #43\". Problem Description & Analysis:\nA table in Oracle database has a column of datetime type, corresponding to multiple pieces of data per day:\n\nTask: Now we need to find two records every day, one closest to 8am that day and one closest to 8pm that day...."
url: "https://hashnode.com/posts/query-the-records-closest-to-the-specified-time-each-day-from-sql-to-spl-43/685ca1705075534086cab4c4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Query the Records Closest to the Specified Time Each Day — From SQL to SPL #43](https://esproc-desktop.hashnode.dev/query-the-records-closest-to-the-specified-time-each-day-from-sql-to-spl-43?utm_source=hashnode&utm_medium=feed)

Problem Description & Analysis: A table in Oracle database has a column of datetime type, corresponding to multiple pieces of data per day: Task: Now we need to find two records every day, one closest to 8am that day and one closest to 8pm that day....

Jun 26, 2025 · 1 min read · esproc-desktop.hashnode.dev  
Read the article

-   [#opensource](https://hashnode.com/tag/opensource)
-   [#oracle](https://hashnode.com/tag/oracle)
-   [#sql](https://hashnode.com/tag/sql)
-   [#sqltutorial](https://hashnode.com/tag/sqltutorial)
-   [#oracle-database](https://hashnode.com/tag/oracle-database)
-   [#databases](https://hashnode.com/tag/databases)
-   [#data](https://hashnode.com/tag/data)
-   [#data-analysis](https://hashnode.com/tag/data-analysis)
-   [#data-analytics](https://hashnode.com/tag/data-analytics)
-   [#productivity](https://hashnode.com/tag/productivity)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)

## Written by

[esProc](https://hashnode.com/@esProcDesktop)

@esProcDesktop

  
[View profile](https://hashnode.com/@esProcDesktop)

esProc SPL is a JVM-based programming language designed for structured data computation, serving as both a data analysis tool and an embedded computing engine. FREE download👉🏻: https://www.esproc.com/download-esproc

## Responses 1

Markdown supported · ⌘↵ to post

[esProc](https://hashnode.com/@esProcDesktop)

[Jun 26, 2025](https://hashnode.com/posts/query-the-records-closest-to-the-specified-time-each-day-from-sql-to-spl-43/685ca1705075534086cab4c4/comment/685ca22af2073d62fe9b833a)

Check out the SPL scripts and feel free to discuss the details with the communities!

🎯Discord:[discord.gg/sxd59A8F2W](https://discord.gg/sxd59A8F2W) 🎯Reddit:[reddit.com/r/esProc\_Desktop](https://www.reddit.com/r/esProc_Desktop/)
