Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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)
);
Comment

how to assign custom id in mysql

CREATE TABLE document_control (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT...
Comment

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)
Comment

PREVIOUS NEXT
Code Example
Sql :: local sql server 
Sql :: foreign key in sql dbms 
Sql :: drop tables from local database postgres pgadmin 
Sql :: sql max count 
Sql :: mysql calcular idade 
Sql :: sql average 
Sql :: sql alter table 
Sql :: REMOVE DATE FROM DATE TIME SQL SERVER 
Sql :: select only columns that are not empty oracle sql 
Sql :: systems sql 
Sql :: create a database mysql 
Sql :: change date in pivot table to month in sql server 
Sql :: create and attach user to a postgresql database 
Sql :: how to switch database in psql 
Sql :: oracle sql count occurrences of value in column 
Sql :: table users 
Sql :: sql query for displaying age from oldest to youngest 
Sql :: mysql comparing dates 
Sql :: oracle select 
Sql :: sql not 
Sql :: mysql ddl 
Sql :: mysql error 1452 
Sql :: datatables server side filter where clause 
Sql :: is firebase nosql 
Sql :: mysql backup certain tables workbench 
Sql :: sqllite format 
Sql :: use table postgres 
Sql :: ring execute query then print the query result. 
Sql :: 5000/208 
Sql :: mysql delete connected entries from database 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =