最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
MySQL sequence is a set of integers: 1, 2, 3,. Because a data table can only have one field self-increasing primary key, if you want to achieve automatic addition of other fields, you can use MySQL sequence to achieve.
In this chapter we will show you how to use the sequence of MySQL. The easiest way to use sequences in MySQL is to use MySQL The data table insect is created in the following example, and the id in the insect table can grow automatically without specifying a value. In the client of MySQL, you can use the Functions are also provided in the PHP or PERL scripts to get the values of the self-incrementing columns in the final insert table. Use PHP passed Use AUTO_INCREMENT ¶
AUTO_INCREMENT To define the sequence.Example ¶
mysql> CREATE TABLE insect -> ( -> id INT UNSIGNED NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (id), -> name VARCHAR(30) NOT NULL, # type of insect -> date DATE NOT NULL, # date collected -> origin VARCHAR(30) NOT NULL # where collected ); Query OK, 0 rows affected (0.02 sec) mysql> INSERT INTO insect (id,name,date,origin) VALUES -> (NULL,'housefly','2001-09-10','kitchen'), -> (NULL,'millipede','2001-09-10','driveway'), -> (NULL,'grasshopper','2001-09-10','front yard'); Query OK, 3 rows affected (0.02 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM insect ORDER BY id; +----+-------------+------------+------------+ | id | name | date | origin | +----+-------------+------------+------------+ | 1 | housefly | 2001-09-10 | kitchen | | 2 | millipede | 2001-09-10 | driveway | | 3 | grasshopper | 2001-09-10 | front yard | +----+-------------+------------+------------+ 3 rows in set (0.00 sec)
获取AUTO_INCREMENT值 ¶
LAST_INSERT_ID( ) Function to get the value of the self-incrementing column in the last inserted table.PERL instance ¶
mysql_insertid Property to get the AUTO_INCREMENT The value of. Examples are as follows:$dbh->do ("INSERT INTO insect (name,date,origin) VALUES('moth','2001-09-14','windowsill')"); my $seq = $dbh->{mysql_insertid}; PHP instance ¶
mysql_insert_id () Function to get the executed insert SQL statement AUTO_INCREMENT Value of the column.