Thread

  1. get last sequence

    Mr. Chan <daatmor@hongkong.com> — 2001-01-24T16:27:44Z

    dear all,
        how to get last sequence from postgresql? I mean such mysql
    last_insert_id function or ms sql select @@identity.
    thanks!
    Chan
    
    
    
    
  2. Re: get last sequence

    Alfonso Peniche <alfonso@iteso.mx> — 2001-01-27T01:50:22Z

    "Mr. Chan" wrote:
    
    > dear all,
    >     how to get last sequence from postgresql? I mean such mysql
    > last_insert_id function or ms sql select @@identity.
    > thanks!
    > Chan
    
    Select currval('sequence_name_id') from tablename;
    
    this will give you the last sequence generated in tablename