<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Waldar's SQLing and Datawarehousing Place</title>
	<atom:link href="http://www.waldar.org/blog/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.waldar.org/blog</link>
	<description>SQL behind Business Intelligence</description>
	<lastBuildDate>Tue, 22 Sep 2009 12:03:20 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on TSQL Challenge #13 Break The Batches, Pacmann Arithmetics Around Case by Waldar</title>
		<link>http://www.waldar.org/blog/200909/tsql-challenge-13-break-batch-pacmann-arithmetics-case/comment-page-1#comment-35</link>
		<dc:creator>Waldar</dc:creator>
		<pubDate>Tue, 22 Sep 2009 12:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=489#comment-35</guid>
		<description>In fact, this time Oracle is the winner.

With the fixed integers test including the case statement, I ran 1e8 loops in Oracle in 16.4 seconds against 1e7 loops in SQL Server in 7.5 seconds.</description>
		<content:encoded><![CDATA[<p>In fact, this time Oracle is the winner.</p>
<p>With the fixed integers test including the case statement, I ran 1e8 loops in Oracle in 16.4 seconds against 1e7 loops in SQL Server in 7.5 seconds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on TSQL Challenge #13 Break The Batches, Pacmann Arithmetics Around Case by Pacmann</title>
		<link>http://www.waldar.org/blog/200909/tsql-challenge-13-break-batch-pacmann-arithmetics-case/comment-page-1#comment-34</link>
		<dc:creator>Pacmann</dc:creator>
		<pubDate>Tue, 22 Sep 2009 11:47:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=489#comment-34</guid>
		<description>Hi Waldar !

You&#039;re right, that&#039;s the way we should always do it... and of course Uncle Tom would agree with you !
&quot;You assume : i don&#039;t care
Test, test, test, show me results and evidence !&quot;
(Right, it&#039;s probably not an exact quote :))

But i&#039;m a bit sad that once again, your results show that SQL Server performs better :) :) :)</description>
		<content:encoded><![CDATA[<p>Hi Waldar !</p>
<p>You&#8217;re right, that&#8217;s the way we should always do it&#8230; and of course Uncle Tom would agree with you !<br />
&#8220;You assume : i don&#8217;t care<br />
Test, test, test, show me results and evidence !&#8221;<br />
(Right, it&#8217;s probably not an exact quote :))</p>
<p>But i&#8217;m a bit sad that once again, your results show that SQL Server performs better :) :) :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Jaro-Winkler&#8217;s Algorithm Part One, Oracle utl_match Built-in Function by 100 Famous Rock Guitar Riffs &#8211; one take &#124; Guitar Addict&#39;s</title>
		<link>http://www.waldar.org/blog/200909/jaro-winkler-algorithm-p1-oracle-utl_match/comment-page-1#comment-33</link>
		<dc:creator>100 Famous Rock Guitar Riffs &#8211; one take &#124; Guitar Addict&#39;s</dc:creator>
		<pubDate>Wed, 16 Sep 2009 00:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=435#comment-33</guid>
		<description>[...] Jaro-Winkler&#039;s Algorithm Part One, Oracle utl_match Built-in &#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] Jaro-Winkler&#39;s Algorithm Part One, Oracle utl_match Built-in &#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by TSQL Challenge #13 Break The Batches, Pacmann Arithmetics Around Case at Waldar&#8217;s SQLing and Datawarehousing Place</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-32</link>
		<dc:creator>TSQL Challenge #13 Break The Batches, Pacmann Arithmetics Around Case at Waldar&#8217;s SQLing and Datawarehousing Place</dc:creator>
		<pubDate>Tue, 08 Sep 2009 20:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-32</guid>
		<description>[...] instruction about integers using arithmetics function. He already did this for date functions in the comments of this topic. I hope he will sum it up in a clean and well explained post that I could refer to [...]</description>
		<content:encoded><![CDATA[<p>[...] instruction about integers using arithmetics function. He already did this for date functions in the comments of this topic. I hope he will sum it up in a clean and well explained post that I could refer to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by Pacmann</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-31</link>
		<dc:creator>Pacmann</dc:creator>
		<pubDate>Mon, 31 Aug 2009 10:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-31</guid>
		<description>- To have the query return any result, substitude &quot;&lt;&quot; with &lt; (copy / paste accident)

Two tricks : 
- As i generated the months between two bounds, the resulting interval was : [0, 11] instead of [1, 12]
... where the value 0 should have been 12.
How can you fix this using only &quot;arithmetic&quot; operators ?
After trying various combinations of interval translations, i was just looking for the &quot;discontinous&quot; expression that would return 1 when 0 and 0 when between 1 and 11.
My first thought was that &quot;floor&quot; is the simplest &quot;discontinous&quot; function.
1 &lt;= x   0 &lt; (12 - x) / 12  floor((12 - x) / 12) = 0
x = 0		=&gt;  (12 - x) / 12 = 1

Then, we just have to use this boolean &quot;belonging&quot; function to add 12 to the base expression only when x = 0 : 
x + 12 * floor((12 - x) / 12)  
(instead of x)

- In the real world, we use date functions to perform operations between two dates, because the year and the months are not in the same radix.
But of course, when you substract yyyymm1 to yyyymm, there should be a simple arithmetic expression that transforms the result into a year / month expression. That&#039;s what all the mod(, 88) stuff is : 
mm - mm1 belongs to [1, 12] when mm &gt; mm1, [99, 88] when mm1 &lt; mm
(mod 88 lets the first interval unchanged, translates the second one into [1, 11])</description>
		<content:encoded><![CDATA[<p>- To have the query return any result, substitude &#8220;&lt;&#8221; with &lt; (copy / paste accident)</p>
<p>Two tricks :<br />
- As i generated the months between two bounds, the resulting interval was : [0, 11] instead of [1, 12]<br />
&#8230; where the value 0 should have been 12.<br />
How can you fix this using only &quot;arithmetic&quot; operators ?<br />
After trying various combinations of interval translations, i was just looking for the &quot;discontinous&quot; expression that would return 1 when 0 and 0 when between 1 and 11.<br />
My first thought was that &quot;floor&quot; is the simplest &quot;discontinous&quot; function.<br />
1 &lt;= x   0 &lt; (12 &#8211; x) / 12  floor((12 &#8211; x) / 12) = 0<br />
x = 0		=&gt;  (12 &#8211; x) / 12 = 1</p>
<p>Then, we just have to use this boolean &#8220;belonging&#8221; function to add 12 to the base expression only when x = 0 :<br />
x + 12 * floor((12 &#8211; x) / 12)<br />
(instead of x)</p>
<p>- In the real world, we use date functions to perform operations between two dates, because the year and the months are not in the same radix.<br />
But of course, when you substract yyyymm1 to yyyymm, there should be a simple arithmetic expression that transforms the result into a year / month expression. That&#8217;s what all the mod(, 88) stuff is :<br />
mm &#8211; mm1 belongs to [1, 12] when mm &gt; mm1, [99, 88] when mm1 &lt; mm<br />
(mod 88 lets the first interval unchanged, translates the second one into [1, 11])</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by TSQL Challenge #12 Using Date Functions And Recursive CTE, Laurent Schneider Fun Stuff at Waldar&#8217;s SQLing and Datawarehousing Place</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-30</link>
		<dc:creator>TSQL Challenge #12 Using Date Functions And Recursive CTE, Laurent Schneider Fun Stuff at Waldar&#8217;s SQLing and Datawarehousing Place</dc:creator>
		<pubDate>Tue, 25 Aug 2009 01:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-30</guid>
		<description>[...] couldn&#039;t use (nor understand) the arithmetics Pacmann used in the comments of the previous blog [...]</description>
		<content:encoded><![CDATA[<p>[...] couldn&#39;t use (nor understand) the arithmetics Pacmann used in the comments of the previous blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by Pacmann</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-29</link>
		<dc:creator>Pacmann</dc:creator>
		<pubDate>Tue, 18 Aug 2009 07:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-29</guid>
		<description>Hehe, I didn&#039;t notice my mistake... until i was posting it (and comparing to your results). I should have corrected every interval... But instead i just hoped noone would see the cheat :)

Thanks for linking my Pacblog !
Of course i&#039;ve linked yours too (first of all i had to find out how the administration interface works :)). There are now too sites : your&#039;s and the Master&#039;s !</description>
		<content:encoded><![CDATA[<p>Hehe, I didn&#8217;t notice my mistake&#8230; until i was posting it (and comparing to your results). I should have corrected every interval&#8230; But instead i just hoped noone would see the cheat :)</p>
<p>Thanks for linking my Pacblog !<br />
Of course i&#8217;ve linked yours too (first of all i had to find out how the administration interface works :)). There are now too sites : your&#8217;s and the Master&#8217;s !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by Waldar</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-28</link>
		<dc:creator>Waldar</dc:creator>
		<pubDate>Thu, 13 Aug 2009 22:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-28</guid>
		<description>Hi Pacmann ! Glad to see you around here, I hope you noticed that I&#039;ve added the pacblog to the links.

You did a small cheat in your solution adding the current month into the initial rowset !

It&#039;s always nice to see other ways on how to solve the same problem !</description>
		<content:encoded><![CDATA[<p>Hi Pacmann ! Glad to see you around here, I hope you noticed that I&#8217;ve added the pacblog to the links.</p>
<p>You did a small cheat in your solution adding the current month into the initial rowset !</p>
<p>It&#8217;s always nice to see other ways on how to solve the same problem !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 ! by Pacmann</title>
		<link>http://www.waldar.org/blog/200908/nocoug-sql-challenge-author-solution-tsql-challenge-12/comment-page-1#comment-27</link>
		<dc:creator>Pacmann</dc:creator>
		<pubDate>Thu, 13 Aug 2009 20:46:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=401#comment-27</guid>
		<description>Hi Waldar !

It&#039;s always a pleasure to visit your blog.
Until now, i just enjoyed your posts, and was each time really impressed to see you were always learning / finding new tricks :)

But today, i was really motivated by this #12 challenge and tried to write a little variation of your query.

I tried it in the opposite way : prepare the data with lead function, then theta-join it with the number CTE...
The rest are just practical jokes (maybe because i was bored at the office :)) : 
- using arithmetic difference and mod manipulation to avoid the date functions
- arithmetic tricks to change a 0 into a 12 without CASE
- row generation with dba_objects...


Hum, i&#039;m just looking forward to see your T-SQL implementation !


Good luck ;)


[sql]with t as (
SELECT    to_number(to_char(sysdate, &#039;yyyymm&#039;))    as ym,    100    as sc FROM DUAL UNION ALL
SELECT    200903    as ym,    100    as sc FROM DUAL UNION ALL
SELECT    200803    ,    95    FROM DUAL UNION ALL
SELECT    200802    ,    99    FROM DUAL UNION ALL
SELECT    200801    ,    100    FROM DUAL UNION ALL
SELECT    200711    ,    100    FROM DUAL
)
, u as(
select t.ym, lead(ym, 1) over(order by ym desc) ymprv, lead(sc, 1) over (order by ym desc) as sc, row_number() over(order by ym desc) rk
from t) 
 , v as (
select  u.ym - ymprv as diffbrut, ym, ymprv, sc, trunc((u.ym - ymprv)/100) as diffy, mod(mod(u.ym - ymprv, 100), 88) as diffm
from u
)
, w as (
select row_number() over(order by null) nb 
from dba_objects)
, x as (
select v.sc,v.ym - trunc(w.nb / 12) * 100 - mod(w.nb, 12) as res, ym, nb
from v join w on w.nb &lt;= v.diffy * 12 + v.diffm 
)
select  trunc(res / 100) * 100 + mod(mod(res, 100), 88) - 88 * trunc( (12 - mod(mod(res, 100), 88)) / 12) as res, sc
from x
union all 
select ym, sc 
from u
where rk = 1
order by res desc 

      RES         SC
--------- ----------
   200908        100
   200907        100
   200906        100
   200905        100
   200904        100
   200903        100
   200902         95
   200901         95
   200812         95
   200811         95
   200810         95
   200809         95
   200808         95
   200807         95
   200806         95
   200805         95
   200804         95
   200803         95
   200802         99
   200801        100
   200712        100
   200711        100[/sql]</description>
		<content:encoded><![CDATA[<p>Hi Waldar !</p>
<p>It's always a pleasure to visit your blog.<br />
Until now, i just enjoyed your posts, and was each time really impressed to see you were always learning / finding new tricks :)</p>
<p>But today, i was really motivated by this #12 challenge and tried to write a little variation of your query.</p>
<p>I tried it in the opposite way : prepare the data with lead function, then theta-join it with the number CTE...<br />
The rest are just practical jokes (maybe because i was bored at the office :)) :<br />
- using arithmetic difference and mod manipulation to avoid the date functions<br />
- arithmetic tricks to change a 0 into a 12 without CASE<br />
- row generation with dba_objects...</p>
<p>Hum, i'm just looking forward to see your T-SQL implementation !</p>
<p>Good luck ;)</p>
<div class="igBar"><span id="lsql-1"><a href="#" onclick="javascript:showCodeTxt('sql-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="sql-1">
<div class="sql"><span style="color: #993333; font-weight: bold;">WITH</span> t <span style="color: #993333; font-weight: bold;">AS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; to_number<span style="color:#006600; font-weight:bold;">&#40;</span>to_char<span style="color:#006600; font-weight:bold;">&#40;</span>sysdate, <span style="color: #ff0000;">'yyyymm'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AS</span> ym,&nbsp; &nbsp; <span style="color: #cc66cc;">100</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AS</span> sc <span style="color: #993333; font-weight: bold;">FROM</span> DUAL UNION <span style="color: #993333; font-weight: bold;">ALL</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; <span style="color: #cc66cc;">200903</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AS</span> ym,&nbsp; &nbsp; <span style="color: #cc66cc;">100</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AS</span> sc <span style="color: #993333; font-weight: bold;">FROM</span> DUAL UNION <span style="color: #993333; font-weight: bold;">ALL</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; <span style="color: #cc66cc;">200803</span>&nbsp; &nbsp; ,&nbsp; &nbsp; <span style="color: #cc66cc;">95</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> DUAL UNION <span style="color: #993333; font-weight: bold;">ALL</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; <span style="color: #cc66cc;">200802</span>&nbsp; &nbsp; ,&nbsp; &nbsp; <span style="color: #cc66cc;">99</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> DUAL UNION <span style="color: #993333; font-weight: bold;">ALL</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; <span style="color: #cc66cc;">200801</span>&nbsp; &nbsp; ,&nbsp; &nbsp; <span style="color: #cc66cc;">100</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> DUAL UNION <span style="color: #993333; font-weight: bold;">ALL</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; &nbsp; <span style="color: #cc66cc;">200711</span>&nbsp; &nbsp; ,&nbsp; &nbsp; <span style="color: #cc66cc;">100</span>&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">FROM</span> DUAL<br />
<span style="color:#006600; font-weight:bold;">&#41;</span><br />
, u <span style="color: #993333; font-weight: bold;">AS</span><span style="color:#006600; font-weight:bold;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> t.ym, lead<span style="color:#006600; font-weight:bold;">&#40;</span>ym, <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> over<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> ym <span style="color: #993333; font-weight: bold;">DESC</span><span style="color:#006600; font-weight:bold;">&#41;</span> ymprv, lead<span style="color:#006600; font-weight:bold;">&#40;</span>sc, <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> over <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> ym <span style="color: #993333; font-weight: bold;">DESC</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> sc, row_number<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> over<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> ym <span style="color: #993333; font-weight: bold;">DESC</span><span style="color:#006600; font-weight:bold;">&#41;</span> rk<br />
<span style="color: #993333; font-weight: bold;">FROM</span> t<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp;, v <span style="color: #993333; font-weight: bold;">AS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; u.ym - ymprv <span style="color: #993333; font-weight: bold;">AS</span> diffbrut, ym, ymprv, sc, trunc<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>u.ym - ymprv<span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color: #cc66cc;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> diffy, mod<span style="color:#006600; font-weight:bold;">&#40;</span>mod<span style="color:#006600; font-weight:bold;">&#40;</span>u.ym - ymprv, <span style="color: #cc66cc;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #cc66cc;">88</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> diffm<br />
<span style="color: #993333; font-weight: bold;">FROM</span> u<br />
<span style="color:#006600; font-weight:bold;">&#41;</span><br />
, w <span style="color: #993333; font-weight: bold;">AS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> row_number<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> over<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color:#006600; font-weight:bold;">&#41;</span> nb <br />
<span style="color: #993333; font-weight: bold;">FROM</span> dba_objects<span style="color:#006600; font-weight:bold;">&#41;</span><br />
, x <span style="color: #993333; font-weight: bold;">AS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> v.sc,v.ym - trunc<span style="color:#006600; font-weight:bold;">&#40;</span>w.nb / <span style="color: #cc66cc;">12</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color: #cc66cc;">100</span> - mod<span style="color:#006600; font-weight:bold;">&#40;</span>w.nb, <span style="color: #cc66cc;">12</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> res, ym, nb<br />
<span style="color: #993333; font-weight: bold;">FROM</span> v <span style="color: #993333; font-weight: bold;">JOIN</span> w <span style="color: #993333; font-weight: bold;">ON</span> w.nb &amp;lt;= v.diffy * <span style="color: #cc66cc;">12</span> + v.diffm <br />
<span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span>&nbsp; trunc<span style="color:#006600; font-weight:bold;">&#40;</span>res / <span style="color: #cc66cc;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color: #cc66cc;">100</span> + mod<span style="color:#006600; font-weight:bold;">&#40;</span>mod<span style="color:#006600; font-weight:bold;">&#40;</span>res, <span style="color: #cc66cc;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #cc66cc;">88</span><span style="color:#006600; font-weight:bold;">&#41;</span> - <span style="color: #cc66cc;">88</span> * trunc<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;">12</span> - mod<span style="color:#006600; font-weight:bold;">&#40;</span>mod<span style="color:#006600; font-weight:bold;">&#40;</span>res, <span style="color: #cc66cc;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #cc66cc;">88</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> / <span style="color: #cc66cc;">12</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> res, sc<br />
<span style="color: #993333; font-weight: bold;">FROM</span> x<br />
union <span style="color: #993333; font-weight: bold;">ALL</span> <br />
<span style="color: #993333; font-weight: bold;">SELECT</span> ym, sc <br />
<span style="color: #993333; font-weight: bold;">FROM</span> u<br />
<span style="color: #993333; font-weight: bold;">WHERE</span> rk = <span style="color: #cc66cc;">1</span><br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> res <span style="color: #993333; font-weight: bold;">DESC</span> </p>
<p>&nbsp; &nbsp; &nbsp; RES&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SC<br />
<span style="color: #808080; font-style: italic;">--------- ----------</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200908</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200907</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200906</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200905</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200904</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200903</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200902</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200901</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200812</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200811</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200810</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200809</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200808</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200807</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200806</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200805</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200804</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200803</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">95</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200802</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #cc66cc;">99</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200801</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200712</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span><br />
&nbsp; &nbsp;<span style="color: #cc66cc;">200711</span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">100</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NoCOUG&#8217;s First SQL Challenge ! by Results of the First International NoCOUG SQL Challenge &#171; So Many Oracle Manuals, So Little Time</title>
		<link>http://www.waldar.org/blog/200904/nocougs-first-sql-challenge/comment-page-1#comment-26</link>
		<dc:creator>Results of the First International NoCOUG SQL Challenge &#171; So Many Oracle Manuals, So Little Time</dc:creator>
		<pubDate>Wed, 12 Aug 2009 17:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.waldar.org/blog/?p=20#comment-26</guid>
		<description>[...] seventh solution—by Fabien Contaminard from France—was based on the multinomial probability distribution, an [...]</description>
		<content:encoded><![CDATA[<p>[...] seventh solution—by Fabien Contaminard from France—was based on the multinomial probability distribution, an [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
