WITH aquery AS
(SELECT emailid after_gap,
LAG(emailid,1,0) OVER (ORDER BY emailid) before_gap
FROM lgncc_emaildetails)
SELECT
before_gap, after_gap
FROM
aquery
WHERE
before_gap != 0
AND
after_gap – before_gap > 1
ORDER BY
before_gap;
This entry was posted on Monday, March 1st, 2010 at 12:38 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.