Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.package.repository;
- @Repository
- public interface UserRepository extends JpaRepository<User, Long> {
- @Query(value = "SELECT DISTINCT MONTH(created_at) AS numMonth, COUNT(*) AS count " +
- "FROM user WHERE active = 1 AND dtype = 'UserApp' " +
- "AND created_at BETWEEN DATE_ADD(created_at, INTERVAL -6 MONTH) AND created_at " +
- "GROUP BY MONTH(created_at)", nativeQuery = true)
- List<MonthAndCount> getCountDistinctByMonth();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement