{"id":7379,"date":"2021-01-14T23:07:05","date_gmt":"2021-01-15T04:07:05","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=7379"},"modified":"2021-01-14T23:07:05","modified_gmt":"2021-01-15T04:07:05","slug":"oracle-query-timestamp-today","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=7379","title":{"rendered":"Oracle: Query Timestamp Today"},"content":{"rendered":"<p>I wanted a quick way to query a logging table for <em>today&#8217;s<\/em> records. I figured there had to be some way to put a variable &#8220;today&#8221; into the query rather than put in the numbers for the current date. Voila &#8212; a query that retrieves records where the timestamp is greater than or equal to today:<\/p>\n<pre>select *\r\nfrom ossa_central_logging\r\nwhere action_ts &gt;= cast(trunc(current_timestamp) as timestamp)\r\norder by action_ts desc;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I wanted a quick way to query a logging table for today&#8217;s records. I figured there had to be some way to put a variable &#8220;today&#8221; into the query rather than put in the numbers for the current date. Voila &#8212; a query that retrieves records where the timestamp is greater than or equal to &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1004],"tags":[595,922,1256],"class_list":["post-7379","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-oracle","tag-sql","tag-sql-query"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7379"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7379\/revisions"}],"predecessor-version":[{"id":7380,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7379\/revisions\/7380"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}