currval() without specifying the sequence name - Mailing list pgsql-sql

From ow
Subject currval() without specifying the sequence name
Date
Msg-id 20040309135021.57085.qmail@web60808.mail.yahoo.com
Whole thread Raw
Responses Re: currval() without specifying the sequence name
Re: currval() without specifying the sequence name
List pgsql-sql
Hi,

Is there a way to retrieve the current value (i.e. the last used value) of the
last used sequence without specifying the sequence name? Something like the
following:

create table ( id serial, value varchar(10));
insert into someOthertest (value) values ('100');
insert into test (value) values ('10');
insert into test (value) values ('20');

select currval() should returns 2 (the last value of the test table sequence)

Thanks




__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com


pgsql-sql by date:

Previous
From:
Date:
Subject: Re: Trying to make efficient "all vendors who can provide all items"
Next
From: Achilleus Mantzios
Date:
Subject: Re: currval() without specifying the sequence name