Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Student ApplicationDate
- ------- ---------------
- Barry 2009-01-01
- Barry 2009-01-20
- Barry 2009-01-23
- Barry 2009-02-01
- Barry 2009-02-15
- Barry 2009-03-01
- Student Month Applications
- ------- ----- ------------
- Barry 1/2009 3
- Barry 2/2009 2
- Barry 3/2009 1
- SELECT
- student,
- DATE_FORMAT(ApplicationDate,'%m/%Y') as Month
- count(id) as Applications
- from YourTable
- group by ApplicationDate
- select
- student,
- year(ApplicationDate),
- month(ApplicationDate),
- count(*) as Applications
- from YourTable
- group by student, year(ApplicationDate), month(ApplicationDate)
- select Student,
- DATE_FORMAT(ApplicationDate,'%m/%Y') as 'Month',
- count(*) as 'Applications'
- from tableName
- group by Student, month(ApplicationDate), year(AppilcationDate)
- order by year(ApplicationDate), month(ApplicationDate), Student
- select Student, month(ApplicationDate) ApplicationMonth, count(*)
- from table_name
- group by Student, ApplicationMonth
Add Comment
Please, Sign In to add comment