sql >> Databáze >  >> RDS >> Mysql

Skupina DateTime podle data a hodiny

SQL Server:

SELECT [activity_dt], count(*)
FROM table1
GROUP BY DATEPART(day, [activity_dt]), DATEPART(hour, [activity_dt]);

Oracle :

SELECT [activity_dt], count(*)
FROM table1
GROUP BY TO_CHAR(activity_dt, 'DD'), TO_CHAR(activity_dt, 'hh');

MySQL:

SELECT [activity_dt], count(*)
FROM table1
GROUP BY hour( activity_dt ) , day( activity_dt )


  1. co je @JoinColumn a jak se používá v Hibernate

  2. Rozdíl mezi LIKE a =v MYSQL?

  3. Jak zaokrouhlit datum a čas v MySQL?

  4. Napište optimalizace pro Qualcomm Centriq 2400 v MariaDB 10.3.5 Release Candidate