patternsqlModerate
Getting midnight of today
Viewed 0 times
midnighttodaygetting
Problem
I want to get 00:00:00 of a day. Should be done without using
We can use
I want add default value 00:00:00 with
CONCAT. What options are there?We can use
CURDATE() function in select query but need to display like 2014-05-05 00:00:00. If NOW() will give like 2014-05-05 12:05:37.I want add default value 00:00:00 with
CURDATE() in query.Solution
The documentation surprisigly contains a solution:
(which is basically the same as a comment above).
SELECT timestamp(current_date);(which is basically the same as a comment above).
Code Snippets
SELECT timestamp(current_date);Context
StackExchange Database Administrators Q#152585, answer score: 13
Revisions (0)
No revisions yet.