Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support timestamp and time functions on SQL fliters

See original GitHub issue

Had a conversation today with a user who wanted to be able to apply a filter like the following:

SELECT * WHERE time < NOW() - "5 minutes"

It would be handy to have a timestamp type and a handful of time-related functions. Off the top of my head:

  • NOW()

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

evankandersoncommented, Jul 13, 2021

I’d probably lean towards whatever is in the SQL-99 standard (or later equivalent); I picked those out of a SQL manpage, but this book seems to be freely available and cover the standard itself.

duglincommented, Jul 21, 2021

INTERVAL '5' MINUTE is an interesting syntax. Seems like a reason thing to do. Someone want to submit a PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to filter timstamps in sql. - Forum - SolarWinds THWACK
I opened the database and I need to filter the dates that alerts have been triggerd. I thought it would have been similar...
Read more >
HOW TO: Use DATE or TIMESTAMP columns to filter data in ...
To filter query results using 'DATE/TIMESTAMP columns' present in tables of IDV, comparison operators (= < > <= ), BETWEEN and IN operators...
Read more >
Working with timestamp values in select statements to filter ...
Answer. Proper casting and or standard SQL date/time functions can be used to help filter on date and time when there is a...
Read more >
Filter/WHERE using timestamp - sql - Stack Overflow
Use DATEPART function. WHERE DATEPART(hh, [Date Column]) between 7 and 17. or. WHERE NOT DATEPART(hh, [Date Column]) between 7 and 17.
Read more >
DATE/TIME Functions in SQL. Tutorial on how to use CAST ...
Working with dates and times is a common practice when working in SQL. Using dates, we can calculate changes over time, trends in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found