[PerlChina] cnhackinit兄的SQL问题

黄叶 hylinux at gmail.com
Thu May 25 22:32:15 PDT 2006


这个是PostgreSQL里的办法。


test=# create table test ( name varchar(4));
CREATE TABLE
test=# insert into test values ('b');
INSERT 0 1
test=# insert into test values ('c');
INSERT 0 1
test=# insert into test values ('d');
INSERT 0 1
test=# insert into test values ('e');
INSERT 0 1
test=# insert into test values ('f');
INSERT 0 1
test=# select nextval('tablename_colname_seq') as line, name from test ;
 line | name
------+------
    2 | b
    3 | c
    4 | d
    5 | e
    6 | f
(5 行)

test=#
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20060526/e59bbf53/attachment.html 


More information about the China-pm mailing list