Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql default timestamp value to be current timestamp

CURRENT_TIMESTAMP

You can use two timestamp in one table. For default, use DEFAULT field first 
and then the rest timestamp fields.

Below query should work.

CREATE TABLE myTable 
(
 id INT,
 date_registered TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 
 date_validated TIMESTAMP
);
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql return 0 if null 
Sql :: mysql workbench download for iinux mint 19.3 
Sql :: how to edit table name in mysql 
Sql :: mysql get date diff in months 
Sql :: mysql grant all privileges to a user 
Sql :: list tables sqlite 
Sql :: sql drop procedure if exists 
Sql :: start mysql server by terminal in linux 
Sql :: mysql date minus 1 day 
Sql :: string to date postgres 
Sql :: c# datetime to sql server datetime 
Sql :: postgres regex remove special characters 
Sql :: select users 
Sql :: oracle search code in packages 
Sql :: VERIFY INDEXES IN SQL ORACLE 
Sql :: postgres get month name from date 
Sql :: postgres change owner of schema 
Sql :: mysql import gz 
Sql :: oracle first and last day of previous month 
Sql :: sql select table header 
Sql :: mysql count words 
Sql :: ver usuarios mysql 
Sql :: create schema postgres 
Sql :: how to alter table name in mysql 
Sql :: having count greater than 1 mysql 
Sql :: jooq convert using gbk 
Sql :: starting mysql service from mac 
Sql :: dirinfo.name my snippets in stored procedure 
Sql :: copy sql table to another table 
Sql :: How to select the nth row in a SQL database table? 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =