<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to find missing values in a sequence with SQL</title>
	<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/</link>
	<description>Stay curious!</description>
	<pubDate>Sat, 30 Aug 2008 04:09:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: charlene</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-15024</link>
		<author>charlene</author>
		<pubDate>Wed, 20 Aug 2008 05:37:01 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-15024</guid>
		<description>if i want to find gap for example a01, a03, a05?</description>
		<content:encoded><![CDATA[<p>if i want to find gap for example a01, a03, a05?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14678</link>
		<author>Jay</author>
		<pubDate>Fri, 30 May 2008 17:49:07 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14678</guid>
		<description>Hey this is a great article... but my problem is more complicated
I want to find the missing sequences for a 3 column join like
Col1     Col2     Col3
1         1        1
1         2        2
1         2        4
2         2        3
2         2        5
3         3        6
3         5        8
And so on... I need to find out all unused permutations in this series.. A query to solve this will be of great help.. Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hey this is a great article&#8230; but my problem is more complicated<br />
I want to find the missing sequences for a 3 column join like<br />
Col1     Col2     Col3<br />
1         1        1<br />
1         2        2<br />
1         2        4<br />
2         2        3<br />
2         2        5<br />
3         3        6<br />
3         5        8<br />
And so on&#8230; I need to find out all unused permutations in this series.. A query to solve this will be of great help.. Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14658</link>
		<author>Daniel</author>
		<pubDate>Tue, 27 May 2008 12:53:35 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14658</guid>
		<description>Greate soution! However I cannot find the gap if it starts with 1. How to solve this?</description>
		<content:encoded><![CDATA[<p>Greate soution! However I cannot find the gap if it starts with 1. How to solve this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14536</link>
		<author>Keith</author>
		<pubDate>Fri, 09 May 2008 18:19:32 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14536</guid>
		<description>Thank you!  Very helpful in solving a skip in a primary key that used to be auto-assigned.</description>
		<content:encoded><![CDATA[<p>Thank you!  Very helpful in solving a skip in a primary key that used to be auto-assigned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14457</link>
		<author>Rob</author>
		<pubDate>Fri, 18 Apr 2008 21:04:28 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14457</guid>
		<description>I really enjoyed this article on "How to find missing values in a sequence with SQL".  I have a related problem involving finding a missing period of time from a datetime field.  For example, I might need to go through a week and find all the times in a variable work day (maybe 8 hours one day and 10 the next) where there is a gap of 5 minutes or more, and keep a sum of the missed time for the day.  For example, if two lines were 1/1/2008 01:00:00 AM and 1/1/2008 01:11:00 AM, then that would be a total of 11 minutes that would be added to the total for the day.  I want to ignore any gaps less than 5 minutes.  Thank you for any help you can give me on this!</description>
		<content:encoded><![CDATA[<p>I really enjoyed this article on &#8220;How to find missing values in a sequence with SQL&#8221;.  I have a related problem involving finding a missing period of time from a datetime field.  For example, I might need to go through a week and find all the times in a variable work day (maybe 8 hours one day and 10 the next) where there is a gap of 5 minutes or more, and keep a sum of the missed time for the day.  For example, if two lines were 1/1/2008 01:00:00 AM and 1/1/2008 01:11:00 AM, then that would be a total of 11 minutes that would be added to the total for the day.  I want to ignore any gaps less than 5 minutes.  Thank you for any help you can give me on this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14361</link>
		<author>John</author>
		<pubDate>Fri, 28 Mar 2008 21:11:25 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14361</guid>
		<description>Fantastic! Thanks for putting in the effort to share your work.</description>
		<content:encoded><![CDATA[<p>Fantastic! Thanks for putting in the effort to share your work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabor Kiss</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14277</link>
		<author>Gabor Kiss</author>
		<pubDate>Mon, 10 Mar 2008 10:09:32 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14277</guid>
		<description>That is a nice solution. However I cannot understand
the semantics of "min(fr.id)". There is no GROUP BY
constriction here. I replaced "MIN(fr.id)" with
simple "fr.id" and I got the same answer.
What did I miss? :-)</description>
		<content:encoded><![CDATA[<p>That is a nice solution. However I cannot understand<br />
the semantics of &#8220;min(fr.id)&#8221;. There is no GROUP BY<br />
constriction here. I replaced &#8220;MIN(fr.id)&#8221; with<br />
simple &#8220;fr.id&#8221; and I got the same answer.<br />
What did I miss? :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabor Kiss</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14276</link>
		<author>Gabor Kiss</author>
		<pubDate>Mon, 10 Mar 2008 10:08:54 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14276</guid>
		<description>select l.id + 1 as start, min(fr.id) - 1 as stop
from sequence as l
    left outer join sequence as r on l.id = r.id - 1
    left outer join sequence as fr on l.id </description>
		<content:encoded><![CDATA[<p>select l.id + 1 as start, min(fr.id) - 1 as stop<br />
from sequence as l<br />
    left outer join sequence as r on l.id = r.id - 1<br />
    left outer join sequence as fr on l.id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobby Breaux</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14222</link>
		<author>Bobby Breaux</author>
		<pubDate>Sat, 16 Feb 2008 19:04:23 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14222</guid>
		<description>Awesome. Thanks so much for publishing this method of checking for missing rows.</description>
		<content:encoded><![CDATA[<p>Awesome. Thanks so much for publishing this method of checking for missing rows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14080</link>
		<author>Cody</author>
		<pubDate>Fri, 14 Dec 2007 15:38:53 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2005/12/06/find-missing-numbers-in-a-sequence-with-sql/#comment-14080</guid>
		<description>Using the example above:

select l.id   1 as start, min(fr.id) - 1 as stop
from sequence as l
    left outer join sequence as r on l.id = r.id - 1
    left outer join sequence as fr on l.id </description>
		<content:encoded><![CDATA[<p>Using the example above:</p>
<p>select l.id   1 as start, min(fr.id) - 1 as stop<br />
from sequence as l<br />
    left outer join sequence as r on l.id = r.id - 1<br />
    left outer join sequence as fr on l.id</p>
]]></content:encoded>
	</item>
</channel>
</rss>
