How to auto increment id with a character
问题 How do I auto-increment an ID of a member in my table together with a character with it for example: M_01 , M_02 , M_03 : CREATE TABLE COMPANY( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE INT NOT NULL, ADDRESS CHAR(50), SALARY REAL ); 回答1: The answer is: Don't. Use a basic serial column. You can always format the column on output. A sensible table definition could look like this (added more suggestions): CREATE TABLE company( company_id serial PRIMARY KEY , birth_year int NOT NULL ,