View Single Post

   
  #8 (permalink)  
Old 05-11-2008, 08:41 PM
Steve Ackman
 
Posts: n/a
Default Re: How to find holes in a sequence?

In <9b3a64b4-aeab-43fb-bc07-ef960a2c34b0@y38g2000hsy.googlegroups.com>,
on Mon, 5 May 2008 13:57:43 -0700 (PDT), cvh@LE,
christian.hansel@cpi-service.com wrote:

> I'm a bit unsure whether I correctly understand what you try to
> accomplish,
> but given you have a table with all numbers 1..79389 you could simply
> run a denying left join query on both tables
> like:
>
> select
> f.id as missing
> from fulltable f left join leafnodes l on f.id=l.nodeid
> where isnull(l.nodeid)


Thanks. Using your example, I was on my way.

select id
from count left join rcm on count.id = rcm.server_id
where Sender is null;
Reply With Quote