snipt

Ctrl+h for KB shortcuts

SQL

Extract date part

dbms_output.put_line(extract(month FROM sysdate));
https://snipt.net/embed/dd5768b743ec75f657f7c18451cb1eb0/
/raw/dd5768b743ec75f657f7c18451cb1eb0/
dd5768b743ec75f657f7c18451cb1eb0
sql
SQL
1
2019-08-21T00:51:00
True
False
False
/api/public/snipt/39807/
extract-date-part
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">dbms_output</span><span class="p">.</span><span class="n">put_line</span><span class="p">(</span><span class="k">extract</span><span class="p">(</span><span class="k">month</span> <span class="k">FROM</span> <span class="n">sysdate</span><span class="p">));</span> </span></pre></div> </td></tr></table>
oracle, sql