Re: [SQL] custom serial number

2008-11-19 Thread A. Kretschmer
am Wed, dem 19.11.2008, um 0:52:07 -0800 mailte mahmoud ewiwi folgendes: > Thank you very much, it works fine with me , but how can i restart the > sequence at the start of each month, or should i do it programatically? For instance, check if a record for the actual month are in the table. If n

Re: [SQL] custom serial number

2008-11-19 Thread mahmoud ewiwi
IL PROTECTED]> > Subject: Re: [SQL] custom serial number > To: "mahmoud ewiwi" <[EMAIL PROTECTED]>, pgsql-sql@postgresql.org > Date: Wednesday, November 19, 2008, 9:45 AM > am Tue, dem 18.11.2008, um 20:56:07 -0800 mailte mahmoud > ewiwi folgendes: > > Thank

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 20:56:07 -0800 mailte mahmoud ewiwi folgendes: > Thank you hery much, it works fine with me , but how can i restart the > sequence at the start of each month, or should i do it programatically? Please answer to the list and not to me. You can write a function for that

Re: [SQL] custom serial number

2008-11-18 Thread Gerardo Herzig
A. Kretschmer wrote: > am Tue, dem 18.11.2008, um 1:09:44 -0800 mailte mahmoud ewiwi folgendes: >> hi gurus >> i have a problem in generating serial number with the form mm how >> can i do that? > > test=# create temporary sequence foo; > CREATE SEQUENCE > test=# select to_char(current_

Re: [SQL] custom serial number

2008-11-18 Thread Pavel Stehule
Hello 2008/11/18 A. Kretschmer <[EMAIL PROTECTED]>: > am Tue, dem 18.11.2008, um 10:37:23 +0100 mailte Pavel Stehule folgendes: >> Hello >> >> what do you wont to do exactly? >> >> you can try - >> >> create sequence s; >> postgres=# create sequence s; >> CREATE SEQUENCE >> postgres=# select to_c

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 10:37:23 +0100 mailte Pavel Stehule folgendes: > Hello > > what do you wont to do exactly? > > you can try - > > create sequence s; > postgres=# create sequence s; > CREATE SEQUENCE > postgres=# select to_char(current_date, 'mmdd') || > trim(to_char(nextval('s'),

Re: [SQL] custom serial number

2008-11-18 Thread Pavel Stehule
Hello what do you wont to do exactly? you can try - create sequence s; postgres=# create sequence s; CREATE SEQUENCE postgres=# select to_char(current_date, 'mmdd') || trim(to_char(nextval('s'), '')); ?column? -- 200811180002 (1 row) postgres=# select to_char(current_dat

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 1:09:44 -0800 mailte mahmoud ewiwi folgendes: > hi gurus > i have a problem in generating serial number with the form mm how can > i do that? test=# create temporary sequence foo; CREATE SEQUENCE test=# select to_char(current_date, 'mm')||trim(to_char(next

[SQL] custom serial number

2008-11-18 Thread mahmoud ewiwi
hi gurus i have a problem in generating serial number with the form mm how can i do that? Mahmoud Al-Ewiwi Al-Mahawer Hebron- Palestine -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql