SELECT COUNT (t) FROM App.Data1 AS t GROUP BY DATE_FORMAT (DATE_TIME, '% Y% m% d');
and SQL statement and execute
An error occurred with Unrecognized function date_format.
If i look at the error, you can see that this error occurred because there is no DATE_FORMAT function in SQL? MySQL? How can I count the number of records per month? How should I modify the SQL statement?
Answer # 1
I don't know the situation, but your RBD is MySQL?
date_format is available?
select date_format ('2018-01-02 11:22:33', '% Y-% m-% d'); select date ('2018-01-02 11:22:33');
Same result as above, date_format can format dates into strings in more formats
Answer # 2
MySQL :: MySQL 5.6 Reference Manual
Extracts the date part of a date or datetime expression expr.
, is it OK to GROUP BY with the DATE ()?
If you rewrite at the desktop debug level
SELECT DATE (t. Date/time data column to be rounded) AS "DATE", COUNT (t) AS "COUNT_DATE" FROM App.Data1 AS t GROUP BY DATE (t. Date/time data column to be rounded);
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved