On Tue, Aug 31, 2010 at 9:07 AM, Eric Smith wrote:
>
> You probably don't want 'SELECT max(foo_id)+1' because I think that does
> a full table scan.
>
>
you're right, but slightly modified version SELECT (SELECT max(foo_id) FROM
MxVft_FTIndex)+1 does not
Max
_
On Aug 30, 2010, at 10:07 PM, Eric Smith wrote:
> Scott Frankel wrote:
>
>> Hi all,
>>
>> How does one find the next value of a serial item? Given a simple
>> table with a serial primary key, I'd like to get the next available
>> integer key value. eg:
>>
>> CREATE TABLE foo (
>> foo_id
Scott Frankel wrote:
> Hi all,
>
> How does one find the next value of a serial item? Given a simple
> table with a serial primary key, I'd like to get the next available
> integer key value. eg:
>
> CREATE TABLE foo (
> foo_id SERIAL PRIMARY KEY,
> name
Perfect. Thanks!
On Aug 30, 2010, at 9:37 PM, Benoit Mortgat wrote:
> On Tue, Aug 31, 2010 at 05:45, Scott Frankel
> wrote:
>
>>
>> Hi all,
>>
>> How does one find the next value of a serial item?
>>
>> SELECT ???;
>>>
>>
>
> max(foo_id) + 1
>
> --
> Benoit Mortgat
> 20, avenue Marcel Paul
On Tue, Aug 31, 2010 at 05:45, Scott Frankel wrote:
>
> Hi all,
>
> How does one find the next value of a serial item?
>
> SELECT ???;
> >
>
max(foo_id) + 1
--
Benoit Mortgat
20, avenue Marcel Paul
69200 Vénissieux, France
+33 6 17 15 41 58
+33 4 27 11 61 23
__
Hi all,
How does one find the next value of a serial item? Given a simple
table with a serial primary key, I'd like to get the next available
integer key value. eg:
CREATE TABLE foo (
foo_id SERIAL PRIMARY KEY,
nametextDEFAU
6 matches
Mail list logo