本日 00:00:00 の YYYY-MM-DD hh:mm:ss を作るSQL
MySQL
mysql> SELECT CONCAT(current_date, ' 00:00:00') AS todays_midnight; +---------------------+ | todays_midnight | +---------------------+ | 2019-10-24 00:00:00 | +---------------------+
PostgreSQL
postgres=# SELECT current_date || ' 00:00:00' AS todays_midnight; todays_midnight --------------------- 2019-10-24 00:00:00
9.1 から concat が使えるらしい。 文字列関数と演算子(9.0) 文字列関数と演算子(9.1)