Re: Simple way to get missing number

Поиск
Список
Период
Сортировка
От Raj Mathur (राज माथुर)
Тема Re: Simple way to get missing number
Дата
Msg-id 201204242059.40709.raju@linux-delhi.org
обсуждение исходный текст
Ответ на Re: Simple way to get missing number  (Andreas Kretschmer <akretschmer@spamfence.net>)
Ответы Re: Simple way to get missing number  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-sql
On Tuesday 24 Apr 2012, Andreas Kretschmer wrote:
> Emi Lu <emilu@encs.concordia.ca> wrote:
> > Good morning,
> > 
> > May I know is there a simple sql command which could return missing
> > numbers please?
> > 
> > For example,
> > 
> > t1(id integer)
> > 
> > values= 1, 2, 3 .... 5000000
> > 
> > select miss_num(id)
> > from   t1 ;
> 
> something like
> 
> ,----[  code  ]
> 
> | test=# select * from emi_lu ;
> | 
> |  i
> | 
> | ---
> | 
> |  1
> |  2
> |  3
> |  5
> |  6
> |  8
> |  9
> | 
> | (7 rows)
> | 
> | Time: 0,246 ms
> | test=*# select * from generate_Series(1,10) s left join emi_lu on
> | (s=emi_lu.i) where i is null;
> | 
> |  s  | i
> | 
> | ----+---
> | 
> |   4 |
> |   7 |
> |  
> |  10 |
> | 
> | (3 rows)

Nice one, but curious about how would this perform if the numbers in 
question extended into 7 figures or more?

Regards,

-- Raj
-- 
Raj Mathur                          || raju@kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves           || http://schizoid.in   || D17F


В списке pgsql-sql по дате отправления:

Предыдущее
От: Emi Lu
Дата:
Сообщение: Re: [GENERAL] Simple way to get missing number
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: Simple way to get missing number