Answers for "how to assign custom id in mysql"

SQL
0

how to assign custom id in mysql

INSERT INTO document_control 
  SELECT CONCAT_WS('-', RIGHT(YEAR(CURRENT_TIMESTAMP), 2), LPAD(COUNT(*) + 1, 3, 0)) 
  FROM document_control
  WHERE LEFT(id_custom, 2) = RIGHT(YEAR(CURRENT_TIMESTAMP), 2)
Posted by: Guest on December-28-2021
0

how to assign custom id in mysql

CREATE TABLE document_control (
  id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  name VARCHAR(10)
);
Posted by: Guest on December-28-2021
0

how to assign custom id in mysql

CREATE TABLE document_control (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT...
Posted by: Guest on December-28-2021

Code answers related to "how to assign custom id in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language