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`,
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 < `To`
--
Gerald L. Clark
Sr. V.P. Development
Supplier Systems Corporation
Unix since 1982
Linux since 1992
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]