postgresql 中怎样在select中直接得到行号(转自:http://topic.csdn.net/u/20070116/11/7c907484-6bb8-4c6d-97b3-243aacb)

test=# create temp sequence test_seq;   
CREATE SEQUENCE
test=# select nextval('test_seq'), name from test;
 nextval | name   
---------+------------
  1 | name text  
  2 | zms text  
  3 | smz text  
  4 | name text  
  5 | zms text  
  6 | smz text  
  7 | name text  
  8 | zms text  
  9 | smz text

你可能感兴趣的:(c,PostgreSQL)