Re: Autoincremental value

Поиск
Список
Период
Сортировка
От adburne@asocmedrosario.com.ar
Тема Re: Autoincremental value
Дата
Msg-id 1428470504.20040817085759@asocmedrosario.com.ar
обсуждение исходный текст
Ответ на Re: Autoincremental value  (Mage <mage@mage.hu>)
Ответы Re: Autoincremental value  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-general
Estimado Mage,

Con fecha viernes 13 de agosto de 2004, 16.54.09, escribió:

M> adburne@asocmedrosario.com.ar wrote:

>>when insert rows:
>>
>>insert into table1 (field1) values (1);
>>insert into table1 (field1) values (1);
>>insert into table1 (field1) values (2);
>>
>>and then select * from table1, you get:
>>field1| field2
>>------+-------
>>  1   |  1
>>  1   |  2
>>  2   |  1
>>------+-------
>>
>>
M> Do you mean:


M>  field1| field2
M>  ------+-------
M>    1   |  1
M>    1   |  2
M>    2   |  3
M>  ------+-------

M> You need the serial type.

M>           Mage


Thnx to everybody for your answers; you put the finger on the key =), in
mysql you can create a mixed autoincremental on 2 fields, then the first
act as key and the second field is autoincremental based on the first
field. Like I wrote in the prev msg.

field1| field2
------+-------
  1   |  1
  1   |  2
  2   |  1
------+-------

I was reading about serial type but I didn't find anything to do this
like mysql.

--
Saludos,
 adburne
 mailto:adburne@asocmedrosario.com.ar


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

Предыдущее
От: Pierre-Frédéric Caillaud
Дата:
Сообщение: Re: Web application: Programming language/Framework
Следующее
От: adburne@asocmedrosario.com.ar
Дата:
Сообщение: Re: Autoincremental value