Re: custom serial number

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: mahmoud_ewiwi(at)yahoo(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: custom serial number
Date: 2008-11-18 09:37:23
Message-ID: 162867790811180137p45226c5dn142194233c39a64d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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, 'yyyymmdd') ||
trim(to_char(nextval('s'), '0000'));
?column?
--------------
200811180002
(1 row)

postgres=# select to_char(current_date, 'yyyymmdd') ||
trim(to_char(nextval('s'), '0000'));
?column?
--------------
200811180003
(1 row)

regards
Pavel Stehule

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2008-11-18 09:42:23 Re: custom serial number
Previous Message A. Kretschmer 2008-11-18 09:26:52 Re: custom serial number