Re: Insert Question
| От | A. Kretschmer |
|---|---|
| Тема | Re: Insert Question |
| Дата | |
| Msg-id | 20061102201828.GA8502@a-kretschmer.de обсуждение исходный текст |
| Ответ на | Insert Question (<operationsengineer1@yahoo.com>) |
| Список | pgsql-novice |
am Thu, dem 02.11.2006, um 12:01:51 -0800 mailte operationsengineer1@yahoo.com folgendes:
> hhi all,
>
> long time no askie question, but here goes...
>
> i want to insert sequential document numbers into a
> products table
>
> my current setup is like so:
>
> product_number document_number
> 1001
> 1002
> 1006
> 1005
>
> i want an insert statement that will yield the
> following:
>
> product_number document_number
> 1001 42000001
> 1002 42000002
> 1006 42000003
> 1005 42000004
Create a sequence that starts with 42000001, and insert
nextval('this_sequence') for this column. (document_number).
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
В списке pgsql-novice по дате отправления: