SELECT CURRENT_TIMESTAMP error | Sololearn: Learn to code for FREE!



I'm trying to use SELECT CURRENT_TIMESTAMP in sql but the database sets it to 0000-00-00 00:00:00; Original code: INSERT INTO articles (title, text, link, date, author) VALUES ('title', 'text', 'link',' (SELECT CURRENT_TIMESTAMP) ','user');

12/16/2018 6:04:45 PM

Arne Van Kerckvoorde

1 Answer

New Answer


use it as constant not as a query. So without quotation and without SELECT. INSERT INTO events (ts,description) VALUES (CURRENT_TIMESTAMP,'disc full');