Re: Last inserted row id with complex PK

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: Last inserted row id with complex PK
Дата
Msg-id CADp-Sm5domLucpSduUhHdweY4e1N--LjUUxzk0TJ9o5o7LZmYg@mail.gmail.com
обсуждение исходный текст
Ответ на Last inserted row id with complex PK  (Nelson Green <nelsongreen84@gmail.com>)
Список pgsql-general

On Wed, Jan 8, 2014 at 11:54 PM, Nelson Green <nelsongreen84@gmail.com> wrote:
I have a projects log table with a three column PK,
project_num, person_num, and sequence, where each new entry for a project/person combination increments the sequence, which is not an auto incrementing sequence. Is there any way to retrieve the last entry to the table? For instance, if the last entry for person 427 on project 15 was sequence number 125, is that information available to me anywhere?


Are these 
project_num, person_num FK from some other table? If yes then I would first insert in those tables and use it over here?

Best Regards,
Sameer Kumar | Database Consultant
ASHNIK PTE. LTD.
101 Cecil Street, #11-11 Tong Eng Building, Singapore 069533
M : +65 8110 0350 T: +65 6438 3504 | www.ashnik.com
www.facebook.com/ashnikbiz | www.twitter.com/ashnikbiz

email patch

This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s).

Вложения

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

Предыдущее
От: Raghavendra
Дата:
Сообщение: Re: general questions
Следующее
От: Sameer Kumar
Дата:
Сообщение: Re: How to know server status variable in postgresql?