表格中需要创建一个autoincrement的字段,它记录了最后插入表格的自动增加的ID值

解决方案 »

  1.   

    @@IDENTITY能在mysql里头用?  针对一个autoincrement的表?
      

  2.   

    呵呵,不是的,autoincrement 是字段的一个属性,指定它后,该字段就是自增字段建议你看一下 MySQL 参考手册中的 CREATE TABLE 语句相关描述,
      

  3.   

    YES, 师兄,善哉善哉, 在MYSQL MANUAL中写道:
    ***************************
    The following is a full list of all variables that you change and retrieve and if you can use GLOBAL or SESSION with them. Variable name  Value type  Type  
    autocommit  bool  SESSION  
    big_tables  bool  SESSION  
    binlog_cache_size  num  GLOBAL  
    bulk_insert_buffer_size  num  GLOBAL | SESSION  
    concurrent_insert  bool  GLOBAL  
    connect_timeout  num  GLOBAL  
    convert_character_set  string  SESSION  
    delay_key_write  OFF | ON | ALL  GLOBAL  
    delayed_insert_limit  num  GLOBAL  
    delayed_insert_timeout  num  GLOBAL  
    delayed_queue_size  num  GLOBAL  
    error_count  num  LOCAL  
    flush  bool  GLOBAL  
    flush_time  num  GLOBAL  
    foreign_key_checks  bool  SESSION  
    identity  num  SESSION  
    ......