CREATE TABLE test( my_date DATE, my_time TIME, my_datetime DATETIME ); INSERT INTO test VALUES(CURRENT_DATE(), CURRENT_TIME(), NOW()); SELECT * FROM test;
When I used the query : INSERT INTO test VALUES (CURRENT_DATE()-1, CURRENT_TIME(), NOW()); On 2021-01-01, It gave me the error: ERROR 1292 (22007): Incorrect date value: '20221200' for column 'my_date' at row 1 Because 2022-12-00 is not valid. So that's something to look out for.
CREATE TABLE test(
my_date DATE,
my_time TIME,
my_datetime DATETIME
);
INSERT INTO test
VALUES(CURRENT_DATE(), CURRENT_TIME(), NOW());
SELECT * FROM test;
What could I do, if I finished creating table and I want to add a new column for date
Woo hoo let's go to another video ❤
Been waiting for this since Java tutorial was released!
Thanks,simple and helpful
thank you bro
Thank you ❤
Excelente, Gracias!!!
precise by the way I'm revisising the sql
Thank u bro
Thank you
INSERT INTO test
VALUES(CONVERT (DATE,GETDATE()), CONVERT (TIME,GETDATE()), GETDATE());
SELECT * FROM test
you're my master
Hey Man!😭✔️❤️you are awesomeeeeeee!!!!
❤
7 in the morning?
similar as using getdate() , but overall good video bro.
When I used the query :
INSERT INTO test
VALUES (CURRENT_DATE()-1, CURRENT_TIME(), NOW());
On 2021-01-01, It gave me the error:
ERROR 1292 (22007): Incorrect date value: '20221200' for column 'my_date' at row 1
Because 2022-12-00 is not valid. So that's something to look out for.
same , have you found the solution?
try this "INSERT INTO test
VALUES (DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY), NULL, NULL);
"
Ravish kumar official
✅ 9th October - 2024
Bro code need to release git tutorial