RE: Finding gaps

2008-10-27 Thread US Data Export
Thanks for the suggestion. Unfortunately that doesn't fit my need, because I need to go back in time. From: Moon's Father [mailto:[EMAIL PROTECTED] Sent: Saturday, October 25, 2008 2:57 AM To: Jerry Schwartz Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Finding gaps Create

Re: Finding gaps

2008-10-25 Thread Moon's Father
-joins. From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 8:22 PM To: US Data Export; mysql@lists.mysql.com Subject: Re: Finding gaps Jerry, Here is a workaround for 4.1.22: SELECT a.id+1 AS 'Missing From', MIN(b.id) - 1 AS 'To' FROM tbl AS a, tbl AS b

Re: Finding gaps

2008-10-25 Thread Moon's Father
: Wednesday, October 08, 2008 8:22 PM To: US Data Export; mysql@lists.mysql.com Subject: Re: Finding gaps Jerry, Here is a workaround for 4.1.22: SELECT a.id+1 AS 'Missing From', MIN(b.id) - 1 AS 'To' FROM tbl AS a, tbl AS b WHERE a.id b.id GROUP BY a.id HAVING `Missing From` MIN

RE: Finding gaps

2008-10-10 Thread Jerry Schwartz
Thanks. Although I've been around SQL for quite a while, I've never really gotten the hang of self-joins. From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 8:22 PM To: US Data Export; mysql@lists.mysql.com Subject: Re: Finding gaps Jerry, Here

RE: Finding gaps

2008-10-08 Thread Jerry Schwartz
www.etudes-marche.com -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:26 PM To: Stut; mysql@lists.mysql.com Subject: Re: Finding gaps Is there any elegant way of finding the gaps? You'll find some ideas under (and near) Find missing numbers

Re: Finding gaps

2008-10-08 Thread Gerald L. Clark
Jerry Schwartz wrote: I'm finally getting back to this issue, and I've read the bits on artfulsoftware. The example SELECT a.id+1 AS 'Missing From', MIN(b.id) - 1 AS 'To' FROM tbl AS a, tbl AS b WHERE a.id b.id GROUP BY a.id HAVING a.id MIN(b.id) - 1; SELECT a.id+1 AS `Missing_From`,

RE: Finding gaps

2008-10-08 Thread US Data Export
-Original Message- From: Gerald L. Clark [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 4:44 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Finding gaps Jerry Schwartz wrote: I'm finally getting back to this issue, and I've read the bits on artfulsoftware

Re: Finding gaps

2008-10-08 Thread Peter Brawley
Subject: Re: Finding gaps Is there any elegant way of finding the gaps? You'll find some ideas under (and near) Find missing numbers in a sequence at http://www.artfulsoftware.com/infotree/queries.php. PB - Stut wrote: On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I

RE: Finding gaps

2008-10-08 Thread US Data Export
Well, 5.x accepted the query. It's been running for awhile, now, so I'll find out later if it did what I need. -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 5:25 PM To: Jerry Schwartz; mysql@lists.mysql.com Subject: Re: Finding gaps I

Re: Finding gaps

2008-10-08 Thread Peter Brawley
To: Jerry Schwartz; mysql@lists.mysql.com Subject: Re: Finding gaps I must be missing something obvious; or does this not work in 4.1.22? Looks like a 4.1.22 bug. PB Jerry Schwartz wrote: I'm finally getting back to this issue, and I've read the bits on artfulsoftware. The example

Re: Finding gaps

2008-09-18 Thread Joerg Bruehe
HI ! Stut schrieb: On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way of finding the gaps? Why do they need to be sequential? When this requirement comes up it's usually for

Re: Finding gaps

2008-09-18 Thread Joerg Bruehe
Hi ! Stut schrieb: On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way of finding the gaps? Why do they need to be sequential? When this requirement comes up it's usually for

Re: Finding gaps

2008-09-18 Thread Stut
On 18 Sep 2008, at 07:45, Joerg Bruehe wrote: Stut schrieb: On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way of finding the gaps? Why do they need to be sequential? When

Re: Finding gaps

2008-09-18 Thread Mr. Shawn H. Corey
On Thu, 2008-09-18 at 09:58 +0100, Stut wrote: Autonumber will accomplish that, so long as you don't delete any. And if you do, renumbering the bookings would cause more problems than it solved. Autonumber has the possibility of gaps. When a record is insert, the counter is

RE: Finding gaps

2008-09-18 Thread Jerry Schwartz
-Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 6:30 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Finding gaps On 17 Sep 2008, at 22:34, Jerry Schwartz wrote: Our Japanese partners will notice and will ask. Similar things have

RE: Finding gaps

2008-09-18 Thread Jerry Schwartz
Yes, that would have been a very good idea. I did not design this. Even if we used auto-increment, my current problem would be the same: finding gaps in the numbering. Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032

Re: Finding gaps

2008-09-18 Thread Mike Diehl
Schwartz wrote: -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 6:30 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Finding gaps On 17 Sep 2008, at 22:34, Jerry Schwartz wrote: Our Japanese partners will notice and will ask

RE: Finding gaps

2008-09-18 Thread Jerry Schwartz
Schwartz; 'Stut' Subject: Re: Finding gaps Hi all, I'm just throwing something out ... How about: select a.id,b.id from dataset a left join dataset b on a.id=b.id+1 where b.id is null; This should find single gaps. It won't find larger gaps. Just my $.02. Mike. On Thursday 18

Finding gaps

2008-09-17 Thread Jerry Schwartz
I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way of finding the gaps? Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX:

Re: Finding gaps

2008-09-17 Thread Stut
On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way of finding the gaps? Why do they need to be sequential? When this requirement comes up it's usually for illogical reasons.

Re: Finding gaps

2008-09-17 Thread Peter Brawley
Is there any elegant way of finding the gaps? You'll find some ideas under (and near) Find missing numbers in a sequence at http://www.artfulsoftware.com/infotree/queries.php. PB - Stut wrote: On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially

RE: Finding gaps

2008-09-17 Thread Jerry Schwartz
www.giiexpress.com www.etudes-marche.com -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:17 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Finding gaps On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially

RE: Finding gaps

2008-09-17 Thread Martin Gainty
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Finding gaps Date: Wed, 17 Sep 2008 22:16:52 +0100 On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should be sequentially (not auto-increment) numbered, but there are gaps. Is there any elegant way

Re: Finding gaps

2008-09-17 Thread Stut
to be in the database. -Stut -- http://stut.net/ -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:17 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Finding gaps On 17 Sep 2008, at 22:12, Jerry Schwartz wrote: I have records that should

Re: Finding gaps

2008-09-17 Thread Mr. Shawn H. Corey
On Wed, 2008-09-17 at 23:29 +0100, Stut wrote: On 17 Sep 2008, at 22:34, Jerry Schwartz wrote: Our Japanese partners will notice and will ask. Similar things have come up before. I want to be pro-active. Notice what? Why would it be bad? What type of data are we dealing with

Re: Missing an answer to an topic (Finding gaps in db)

2002-09-10 Thread Paul DuBois
At 4:54 +0200 9/10/02, Jan Broermann wrote: Hi, I'm missing an answer to a topic which came up a couple of days /weeks ago. For a database i'm administrating I would like to find out, which numbers (of invoices) are missing in our database. Is there a way to get this result set thru SQL? Or do I

Re: Missing an answer to an topic (Finding gaps in db)

2002-09-10 Thread Gelu Gogancea
Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] - Original Message - From: Jan Broermann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 6:01 AM Subject: Missing an answer to an topic (Finding gaps in db) Hi

Missing an answer to an topic (Finding gaps in db)

2002-09-09 Thread Jan Broermann
Hi, I'm missing an answer to a topic which came up a couple of days /weeks ago. For a database i'm administrating I would like to find out, which numbers (of invoices) are missing in our database. Is there a way to get this result set thru SQL? Or do I have to do it with for example Java? I think

Missing an answer to an topic (Finding gaps in db)

2002-09-09 Thread Jan Broermann
Hi, I'm missing an answer to a topic which came up a couple of days /weeks ago. For a database i'm administrating I would like to find out, which numbers (of invoices) are missing in our database. Is there a way to get this result set thru SQL? Or do I have to do it with for example Java? I think

Missing an answer to an topic (Finding gaps in db)

2002-09-09 Thread Jan Broermann
Hi, I'm missing an answer to a topic which came up a couple of days /weeks ago. For a database i'm administrating I would like to find out, which numbers (of invoices) are missing in our database. Is there a way to get this result set thru SQL? Or do I have to do it with for example Java? I think

Finding gaps in date intervals

2002-09-03 Thread Jens Vonderheide
Hi, I have a table with this structure: CREATE TABLE dats ( id INT UNSIGNED NOT NULL, id_ref INT UNSIGNED NOT NULL, start DATE NOT NULL, endDATE NOT NULL ) Now I am trying to create a query that will give me all intervals for which the table does not