<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Cool SQL function: EXTRACT</title>
	<atom:link href="http://awads.net/wp/2005/12/28/cool-sql-function-extract/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<pubDate>Mon, 13 Oct 2008 06:00:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-52041</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 20 Mar 2008 18:30:15 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-52041</guid>
		<description>@Gary: Good idea. Here is an example

&lt;pre&gt;
select
    extract(hour from cast(sysdate as timestamp)) hh,
    extract(minute from cast(sysdate as timestamp)) mi,
    extract(second from cast(sysdate as timestamp))ss
from dual
&lt;/pre&gt;
Thanks.</description>
		<content:encoded><![CDATA[<p>@Gary: Good idea. Here is an example</p>
<pre>
select
    extract(hour from cast(sysdate as timestamp)) hh,
    extract(minute from cast(sysdate as timestamp)) mi,
    extract(second from cast(sysdate as timestamp))ss
from dual
</pre>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Menchen</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-52037</link>
		<dc:creator>Gary Menchen</dc:creator>
		<pubDate>Wed, 19 Mar 2008 20:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-52037</guid>
		<description>You can cast a date to a timestamp and then extract the hour.</description>
		<content:encoded><![CDATA[<p>You can cast a date to a timestamp and then extract the hour.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-51569</link>
		<dc:creator>Glenn</dc:creator>
		<pubDate>Wed, 19 Sep 2007 02:55:35 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-51569</guid>
		<description>&lt;p&gt;Well, this isn't so useful if you want the name of the day instead of a number. Say, "MON" instead of 2. Back to TO_CHAR!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, this isn&#8217;t so useful if you want the name of the day instead of a number. Say, &#8220;MON&#8221; instead of 2. Back to TO_CHAR!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Vollman</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-920</link>
		<dc:creator>Rob Vollman</dc:creator>
		<pubDate>Thu, 29 Dec 2005 19:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-920</guid>
		<description>&lt;p&gt;Yes, I just used this the other day.  I wrapped it in a DECODE to get a text representation of the month.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, I just used this the other day.  I wrapped it in a DECODE to get a text representation of the month.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-915</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Wed, 28 Dec 2005 17:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-915</guid>
		<description>&lt;p&gt;&lt;i&gt;you cannot extract Hour, minute or second from a date&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Yes, the documentation says: &lt;i&gt;The field you are extracting must be a field of the datetime_value_expr or interval_value_expr. For example, you can extract only YEAR, MONTH, and DAY from a DATE value.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;I'm not sure exactly why you cannot get to the hour/minute/second from a DATE using EXTRACT, since a DATE datatype contains a time portion as well (but not fractional seconds).&lt;/p&gt;

&lt;p&gt;It'll be interesting to know what the reason behind this limitation is.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>you cannot extract Hour, minute or second from a date</i></p>
<p>Yes, the documentation says: <i>The field you are extracting must be a field of the datetime_value_expr or interval_value_expr. For example, you can extract only YEAR, MONTH, and DAY from a DATE value.</i></p>
<p>I&#8217;m not sure exactly why you cannot get to the hour/minute/second from a DATE using EXTRACT, since a DATE datatype contains a time portion as well (but not fractional seconds).</p>
<p>It&#8217;ll be interesting to know what the reason behind this limitation is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FranÃ§ois</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-914</link>
		<dc:creator>FranÃ§ois</dc:creator>
		<pubDate>Wed, 28 Dec 2005 15:12:40 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-914</guid>
		<description>&lt;p&gt;You can also get this information with the To_Char() function.&lt;/p&gt;

&lt;p&gt;SELECT to_char(SYSTIMESTAMP,'FF') FROM dual&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You can also get this information with the To_Char() function.</p>
<p>SELECT to_char(SYSTIMESTAMP,&#8217;FF&#8217;) FROM dual</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Schneider</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-913</link>
		<dc:creator>Laurent Schneider</dc:creator>
		<pubDate>Wed, 28 Dec 2005 14:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-913</guid>
		<description>&lt;p&gt;interesting is extracting nanoseconds from timestamp :&lt;/p&gt;

&lt;p&gt;SQL&#62; create table t as select timestamp '2000-01-01 00:00:42.123456789' t from dual;&lt;/p&gt;

&lt;p&gt;Table created.&lt;/p&gt;

&lt;p&gt;SQL&#62; select mod(extract(second from t),1)*1000000000 ns from t;
        NS&lt;/p&gt;

&lt;p&gt;123456789&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>interesting is extracting nanoseconds from timestamp :</p>
<p>SQL&gt; create table t as select timestamp &#8216;2000-01-01 00:00:42.123456789&#8242; t from dual;</p>
<p>Table created.</p>
<p>SQL&gt; select mod(extract(second from t),1)*1000000000 ns from t;<br />
        NS</p>
<p>123456789</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FranÃ§ois</title>
		<link>http://awads.net/wp/2005/12/28/cool-sql-function-extract/#comment-912</link>
		<dc:creator>FranÃ§ois</dc:creator>
		<pubDate>Wed, 28 Dec 2005 13:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=186#comment-912</guid>
		<description>&lt;p&gt;For an unknown reason you cannot extract Hour, minute or second from a date. It works only on Timestamp.
Francois&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For an unknown reason you cannot extract Hour, minute or second from a date. It works only on Timestamp.<br />
Francois</p>
]]></content:encoded>
	</item>
</channel>
</rss>
