mysql sql add created updated timestamp to existing table

Solutions on MaxInterview for mysql sql add created updated timestamp to existing table by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "mysql sql add created updated timestamp to existing table"
Lotta
17 Nov 2016
1ALTER TABLE t1
2ADD COLUMN created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
3ADD COLUMN updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;