<?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 contiguous ranges with SQL</title>
	<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/</link>
	<description>Stay curious!</description>
	<pubDate>Sat, 30 Aug 2008 05:05:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Nonie</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14763</link>
		<author>Nonie</author>
		<pubDate>Tue, 17 Jun 2008 20:14:20 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14763</guid>
		<description>How do I query to indicate missing sequence numbers with an "*", (like the banks to on your bank statement when a check number is missing).  

For example:

1
2
3
6*
7
8
10*
11
12
15*</description>
		<content:encoded><![CDATA[<p>How do I query to indicate missing sequence numbers with an &#8220;*&#8221;, (like the banks to on your bank statement when a check number is missing).  </p>
<p>For example:</p>
<p>1<br />
2<br />
3<br />
6*<br />
7<br />
8<br />
10*<br />
11<br />
12<br />
15*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14517</link>
		<author>Kyle</author>
		<pubDate>Tue, 06 May 2008 00:19:57 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14517</guid>
		<description>This is pretty sweet!
I have a question though... How would one restrict this query to an id range?

For example if you only wanted to find only the ranges between 3 and 12.  Further if you wanted to restrict it on other (non id) factors?

(My data set is more like the numbers 1 to 20 set to true, with the numbers 5, 11, 12, 13, and 14 set to false or missing and I only want the ranges between 3 and 12 of the true ids)

This has given me a great start, thanks!</description>
		<content:encoded><![CDATA[<p>This is pretty sweet!<br />
I have a question though&#8230; How would one restrict this query to an id range?</p>
<p>For example if you only wanted to find only the ranges between 3 and 12.  Further if you wanted to restrict it on other (non id) factors?</p>
<p>(My data set is more like the numbers 1 to 20 set to true, with the numbers 5, 11, 12, 13, and 14 set to false or missing and I only want the ranges between 3 and 12 of the true ids)</p>
<p>This has given me a great start, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dragoljub Ćurčić</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14247</link>
		<author>Dragoljub Ćurčić</author>
		<pubDate>Mon, 25 Feb 2008 16:50:13 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-14247</guid>
		<description>Thanks for a great article. You've helped me a lot!</description>
		<content:encoded><![CDATA[<p>Thanks for a great article. You&#8217;ve helped me a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SteveW</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13710</link>
		<author>SteveW</author>
		<pubDate>Mon, 26 Nov 2007 20:18:45 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13710</guid>
		<description>That's a beautiful thing, man. Very nicely done. Thanks for publishing it!!</description>
		<content:encoded><![CDATA[<p>That&#8217;s a beautiful thing, man. Very nicely done. Thanks for publishing it!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oumar</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13345</link>
		<author>oumar</author>
		<pubDate>Tue, 28 Aug 2007 21:41:57 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13345</guid>
		<description>Any thoughts on how to write a SQL query that works with address ranges? I have a scenario where I need to find overlapping or gaps between ranges of addresses for a given street. For instance I have

SegmentID  Street_name       Left_from addr     left_to_addr

1          Main              10                 99
2          Main              10                 199

There is an overlap of addresses in the table above since the Main1 address range is inculded in Main2 address range. 

I would greatly appreciate your help here as I desperately need a way out of this. Thank you.</description>
		<content:encoded><![CDATA[<p>Any thoughts on how to write a SQL query that works with address ranges? I have a scenario where I need to find overlapping or gaps between ranges of addresses for a given street. For instance I have</p>
<p>SegmentID  Street_name       Left_from addr     left_to_addr</p>
<p>1          Main              10                 99<br />
2          Main              10                 199</p>
<p>There is an overlap of addresses in the table above since the Main1 address range is inculded in Main2 address range. </p>
<p>I would greatly appreciate your help here as I desperately need a way out of this. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DrDebian</title>
		<link>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13308</link>
		<author>DrDebian</author>
		<pubDate>Tue, 14 Aug 2007 19:04:38 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/03/22/find-contiguous-ranges-with-sql/#comment-13308</guid>
		<description>Shouldn't it be "a.id = b.id   1" instead of "a.id = b.id - 1" in the full statement?</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t it be &#8220;a.id = b.id   1&#8243; instead of &#8220;a.id = b.id - 1&#8243; in the full statement?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
